Age | Commit message (Collapse) | Author | Files | Lines |
|
This adds the ability to query, set and delete monitors
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Compute the error cause by the fixed point matrix representation and
display that.
Accept the 'primary' word found in xrandr output and ignore it.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Conflicts:
xrandr.c
|
|
Reported by jidanni at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709569
Signed-off-by: Stéphane Aulery <lkppo@free.fr>
Reviewed-By: Matt Dew <marcoz@osource.org>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
People who want to dick around might think it is safe to run "xrandr -x"
before they know any of the other syntax. When "xrandr -x" again does
not get back to a normal screen, they are stuck having to read a manpage
with reflected text.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Even in verbose mode, why print the same information twice?
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Calculate gamma table using full [0,65536) range and do not make any
assumptions about relation of gamma table size and significant bits.
Gamma table size has nothing to do with number of significant bits in hardware.
In particular we are dealing now with gamma table that has 17 entries and 8
bit precision, there are other GPUs with 10 bit precision and less than 256
entries using partial linear approximation. Deriving assumed gamma table
significant bits from size of gamma table leads to incorrect calculations and
loss of precision. Also XRandR specification never mentions that gamma tables
need to be power of 2.
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
|
|
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
|
|
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Commit a6217be2d5a93a4c7b48f4081a4a8e14c3c97014 restored the ability to
disconnect RandR 1.4 providers from each other, but it's not clear from the
documentation how to actually do that. Try to clarify by mentioning it in the
man page.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
Before the lookup code passing a 0 XID would disconnect,
this fixes it backup.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Interlaced modes generally have an odd VTotal, so we lose half a line
from VTotal when we divide by two. That causes the final refresh rate
to be slightly off. Make VTotal a double to avoid the problem.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Using just one decimal place for dotclock and refresh rates loses quite
a bit of information. When dealing with 60Hz vs. 59.94Hz refresh rate
modes for example, it's useful to see at least two decimal places. For
the dotclock in similar cases, three decimal places seems quite a bit
better than just one.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Rather than printing GUIDs as 16 signed decimal integers, print them in
{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} format.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Localize the specialness of EDID printing by moving it into a single function,
print_edid, which prints the binary EDID data. Remove the is_edid parameter
from everything else.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
Move the body of the code that prints the actual output property values into a
helper function. This will make it easier for this function to select
special-case property printers for properties that need special formatting.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
|
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Only used as an argument to printf. Clears gcc warnings:
xrandr.c: In function ‘capability_name’:
xrandr.c:237:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:239:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:241:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:243:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:245:5: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Most of xrandr's command line options follow the system of single
dashes for single character options (e.g. "-v") and double dashes for
long options ("--version"). The only exceptions are "-display" and
"-help", most likely for historical reasons. To make the behavior
consistent across all options, the following patch adds "--display"
and "--help" as alternatives to the current inconsistency. The man
page got updated as well, recommending double-dash variants for both
options. The old behavior is still supported, so the patch should not
break any existing usage/script.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
The "--newmode" commandline option initializes an XRRModeInfo and passes
it into XRRCreateMode(). calloc(3) it to avoid uninitialized fields.
For consistency, calloc(3) all the places where umode_t's (the wrapper
structure for XRRModeInfo) are allocated.
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Tested-by: Nikhil Mahale <nmahale@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Commit b26fd532b3dab222956ea27eef4e41345978b5b2 redid how xrandr prints
properties. It neglected to put spaces between the values of XA_ATOM
properties, so they all run together. For example,
audio: auto
supported: force-dvioffautoon
Fix this by putting a space after each atom name. In addition, some drivers
create property values with spaces in them, so put commas between entries to
disambiguate. For example,
Broadcast RGB: Automatic
supported: Automatic, Full, Limited 16:235
Do the same for properties with multiple valid ranges.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Conflicts:
xrandr.c
|
|
Sorry I forgot about this in commit 138b6252c0cae6599b6c8a25ffa22ffe70f227c2.
That change introduced a warning:
xrandr.c|645 col 5| warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘XID’ [-Wformat]
Fix that by just casting the XID to unsigned int.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
|
|
These two flags halve and double, respectively, the effective refresh rate of a
mode.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
|
|
The X server sorts the mode list for an output with preferred modes first, and
specifies how many preferred modes there are by setting the npreferred field in
the XRRModeInfo structure.
Update the man page to refer to preferred modes in the plural, and mention that
--auto and --preferred use the *first* preferred mode.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
|
|
Print the usage() text to stdout instead of stderr, and then only if -help is
specified. Also allow --help for consistency.
For other command line syntax errors, introduce a new helper function argerr()
that prints errors of the form
xrandr: %s
Try './xrandr --help' for more information.
and exits. Use that to print proper error messages.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
|
|
The only valid parameters to -o (--orientation) are 0, 1, 2, 3, normal, left,
inverted, and right. xrandr converts the strings to numbers and then checks
that they're within range, but doesn't validate them if it was numeric to begin
with.
Move the range check outside of the if statement so that out-of-range numeric
values are rejected properly.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
|
|
There are piles of places in the code where a variable shadows either another
variable or a global function:
xrandr.c:545:35: warning: declaration of ‘index’ shadows a global declaration [-Wshadow]
xrandr.c:574:9: warning: declaration of ‘index’ shadows a global declaration [-Wshadow]
xrandr.c:967:19: warning: declaration of ‘gamma’ shadows a global declaration [-Wshadow]
xrandr.c:1329:16: warning: declaration of ‘gamma’ shadows a global declaration [-Wshadow]
xrandr.c:2055:28: warning: declaration of ‘outputs’ shadows a global declaration [-Wshadow]
xrandr.c:2068:29: warning: declaration of ‘outputs’ shadows a global declaration [-Wshadow]
xrandr.c:2928:16: warning: declaration of ‘output’ shadows a previous local [-Wshadow]
xrandr.c:2995:15: warning: declaration of ‘output’ shadows a previous local [-Wshadow]
xrandr.c:3016:15: warning: declaration of ‘j’ shadows a previous local [-Wshadow]
xrandr.c:3018:19: warning: declaration of ‘rotations’ shadows a previous local [-Wshadow]
xrandr.c:3116:15: warning: declaration of ‘crtc’ shadows a previous local [-Wshadow]
xrandr.c:3170:8: warning: declaration of ‘k’ shadows a previous local [-Wshadow]
xrandr.c:3243:20: warning: declaration of ‘mode’ shadows a previous local [-Wshadow]
'index' and 'gamma' are C library functions:
index (3) - locate character in string
gamma (3) - (logarithm of the) gamma function
The rest of these are either variables or function parameters.
When possible, move the declaration of a variable into the block where it is
used, including in cases where the same variable is used in multiple blocks but
the later block doesn't depend on the value from the earlier block.
In a few cases, rename the variable in the outer scope to be more specific (e.g.
output -> config_output) so the more generic variable in the inner scope (e.g.
the 'output' variable used to iterate over all outputs) doesn't have to change.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
|
|
Use the name_t infrastructure to allow specifying providers by name, index, or
XID. This means that numbers without a "0x" prefix will now be interpreted as a
indices rather than XIDs. To match that, print provider XIDs in hexadecimal.
Print an error if a provider-related option is specified and RandR 1.4 isn't
supported.
Make get_screen robust against being called multiple times.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
Create a struct _provider to match the existing output, crtc, etc. objects.
Build that from a new get_providers() function. Use that to populate the list
when querying the providers.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
I hope I got the --setprovideroffloadsink parameters the right way around.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Silences -Wformat-nonliteral warnings about them passing through
unknown format arguments to vfprintf.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Regroup AC statements under the Autoconf initialization section.
Regroup AM statements under the Automake initialization section.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
Sample output:
LVDS-0 connected primary 1920x1080+1920+120 [...]
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
|
|
This adds an initial interface to list and configure offload and output
providers.
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
Sufficiently new versions of GCC treat string literals as "const char *" by
default. This means that several places that assign, return, or initialize
char* from a string literal generates a warning:
xrandr.c:54:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:55:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:56:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:57:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:58:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:61:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:62:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:63:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:64:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:65:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:69:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:70:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:71:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:72:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:73:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:74:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:80:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:81:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:82:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:83:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:84:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:85:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:86:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:87:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:88:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:189:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:193:5: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:202:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:204:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:206:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:208:2: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:210:5: warning: return discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:359:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:360:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:361:5: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:593:23: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1189:28: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1191:28: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1587:39: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1588:30: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1589:38: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1590:48: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1591:42: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:1592:25: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:2544:28: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:2546:28: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:2585:28: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
xrandr.c:3228:17: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
Fix as many of these as possible. This introduces one problem:
XRRSetCrtcTransform takes a non-const char* filter parameter even though it
doesn't actually modify the string. Instead of trying to work around that, just
live with the warning for now:
xrandr.c:1459:9: warning: passing argument 4 of ‘XRRSetCrtcTransform’ discards ‘const’ qualifier from pointer target type [enabled by default]
/X/include/X11/extensions/Xrandr.h:383:1: note: expected ‘char *’ but argument is of type ‘const char *’
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
The gamma-correction lookup table values are 16:16:16 X Colors, where the
MSBs are programmed into the hardware lookup table. Rather than compute
values over the entire range [0,65536) (where values below 2^(16 - sigbits)
will receive the same hardware value), compute values over the range
[0,2^sigbits) and left shift by (16 - sigbits) into the MSBs.
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
The gamma-correction lookup table managed through XRR[GS]etCrtcGamma is
2^n in size, where 'n' is the number of significant bits in the X Color.
Each element in the gamma-correction lookup table is a 16:16:16 X Color
(i.e., in the range [0,65536) ). The significant bits of each component
of each element in the lookup table are programmed into the hardware
lookup table. Meaningful values in the gamma-correction lookup table
are thus in the range [0,2^sigbits), where all values are shifted into
the MSBs (i.e., left shifted by (16 - sigificant bits)).
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
To compute a gamma *correction* lookup table, use the specified gamma
value as the divisor in (1.0/gamma). This matches the semantics of
xgamma(1) and the "gamma-value" and "{red,green,blue}-gamma" xorg.conf(5)
options.
For more details, see:
http://www.poynton.com/PDFs/TIDV/Gamma.pdf (Gamma in computer graphics, page 17)
http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/common/xf86cmap.c:ComputeGamma()
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
The information the text conveys is not really needed at that point,
either. It's duplicated later in the manual page.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
|