Giuseppe Bilotta [Tue, 6 Feb 2018 21:02:42 +0000 (22:02 +0100)]
xrandr: gamma and scaling factors must be positive
Giuseppe Bilotta [Mon, 5 Feb 2018 01:01:21 +0000 (02:01 +0100)]
xrandr.man: document the monitor manipulation options
Giuseppe Bilotta [Mon, 5 Feb 2018 00:31:15 +0000 (01:31 +0100)]
xrandr: allow single value for --gamma
Similarly to --scale, accept a single value to be used for all three
components, and refuse values with extra junk after the acceptable
values.
Giuseppe Bilotta [Sun, 16 Jul 2017 12:57:40 +0000 (14:57 +0200)]
xrandr.man: grammar tuning
Rephrase the --scale option paragraph to improve English and be more
consistent in choice of plurals and tense. Also ensure that each
sentence starts on a new line in the roff source.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Giuseppe Bilotta [Sun, 16 Jul 2017 13:05:21 +0000 (15:05 +0200)]
xrandr: stricter --scale argument parsing
We used to accept something like --scale 2x3junk as a valid input
(scaling x by 2 and y by 3), even though this isn't really a valid
scaling factor.
Fix by making sure there is nothing after the parsed number(s).
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Giuseppe Bilotta [Wed, 17 May 2017 15:20:50 +0000 (17:20 +0200)]
xrandr: allow a single value for --scale
This allows using e.g. --scale 0.5 as a shorthand for --scale 0.5x0.5
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Aaron Plattner [Thu, 1 Jun 2017 22:45:59 +0000 (15:45 -0700)]
man: Document the new --filter option
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Pablo De La Garza [Thu, 23 Mar 2017 23:05:02 +0000 (16:05 -0700)]
xrandr: Add a "--filter" flag
Flag can be set to "nearest" or "bilinear"
Signed-off-by: Pablo De La Garza <pdelagarza@nvidia.com>
[aplattner@nvidia.com: Fixed style and whitespace]
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Pali Rohár [Sun, 28 May 2017 21:33:26 +0000 (23:33 +0200)]
Document format of --dpi option in non-ambiguous way
Slash in previous documentation could be misunderstood as part of the
--dpi command line option. So fix it.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Giuseppe Bilotta [Wed, 18 Jan 2017 07:52:23 +0000 (08:52 +0100)]
xrandr: suppress misleading indentation warning
When printing out rotations, we print a space before any item other than
the first, and set `first = False` in each block where we print.
However, this is done in the same line as the conditional that checks if
first is set, which may give the impression that the assignment is also
under the conditional. This is not the case, and recent GCC warns about
this.
Move the assignment to after we print the value we want to print, which
(1) doesn't mislead about the indentation, and
(2) makes logical sense as the _next_ entry is what won't be the first.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Giuseppe Bilotta [Wed, 18 Jan 2017 07:52:09 +0000 (08:52 +0100)]
xrandr: document that we accept '--dpi output'
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mihail Konev [Thu, 26 Jan 2017 04:00:21 +0000 (14:00 +1000)]
autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Emil Velikov [Mon, 9 Mar 2015 12:00:52 +0000 (12:00 +0000)]
autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 24 Jan 2017 00:32:07 +0000 (10:32 +1000)]
autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Aaron Plattner [Tue, 23 Feb 2016 18:22:26 +0000 (10:22 -0800)]
xrandr 1.5.0
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Chris Wilson [Sun, 13 Sep 2015 10:40:37 +0000 (11:40 +0100)]
Only use the current information when setting modes
Before we change the state (e.g. adding a mode or applying one to an
output), we query the screen resources for the right identifiers. This
should only use the current information rather than force a reprobe on
all hardware - not only can that reprobe be very slow (e.g. EDID
timeouts on the order of seconds), but it may perturb the setup that the
user is trying to configure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Thu, 18 Jun 2015 07:27:49 +0000 (08:27 +0100)]
Mark all CRTC as currently unused for second picking CRTC pass
We perform two passes over the CRTC in order to find the preferred CRTC
for each enabled output. In the first pass, we try to preserve the
existing output <-> CRTC relationships (to avoid unnecessary flicker).
If that pass fails, we try again but with all outputs first disabled.
However, the logic to preserve an active CRTC was not disabled along
with the outputs - meaning that if one was active but its associated
output was disabled by the user, then that CRTC would remain unavailable
for other outputs. The result would be that we would try to assign more
CRTC than available (i.e. if the user request 3 new HDMI outputs on a
system with only 3 CRTC, and wished to switch off an active internal
panel, we would report "cannot find CRTC" even though that configuration
could be established.)
Reported-and-tested-by: Nathan Schulte <nmschulte@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson [Thu, 18 Jun 2015 07:27:48 +0000 (08:27 +0100)]
Mark disabling an output as a change in its CRTC
When an output is disabled via the cmdline, we can use that information
to prevent assigning the current CRTC to the output and free it up for
reuse by other outputs in the first pass of picking CRTC.
Reported-and-tested-by: Nathan Schulte <nmschulte@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Aaron Plattner [Thu, 9 Apr 2015 18:14:54 +0000 (11:14 -0700)]
Split verbose mode printing into a helper function
Combine the two forms of verbose mode printing into a single function. Pass the
'current' and 'preferred' flags as arguments. This fixes the code that prints
unassociated modes to print the flags as well.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Keith Packard [Tue, 16 Dec 2014 09:57:45 +0000 (01:57 -0800)]
Add monitor support (v2)
This adds the ability to query, set and delete monitors
v2: [airlied] add list active monitors
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Dave Airlie [Tue, 31 Mar 2015 01:49:00 +0000 (11:49 +1000)]
xrandr: don't return NULL from a void
Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 30 Mar 2015 04:51:49 +0000 (14:51 +1000)]
xrandr: parse property returns correctly.
Xlib uses longs for 32-bit, so when we get values back they
are in longs, this fixes the xrandr parsing code to parse
the correct sized values according to Xlib.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Keith Packard [Wed, 8 Oct 2014 11:16:07 +0000 (13:16 +0200)]
keystone: Report matrix error. Deal with "primary" in xrandr output
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>
Keith Packard [Mon, 9 Jul 2012 17:52:52 +0000 (10:52 -0700)]
Increase keystone.5c default window size
Aaron Plattner [Sat, 2 Aug 2014 06:14:42 +0000 (23:14 -0700)]
xrandr 1.4.3
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Aaron Plattner [Sat, 2 Aug 2014 06:10:46 +0000 (23:10 -0700)]
Merge commit '
193a358'
Conflicts:
xrandr.c
Stéphane Aulery [Sat, 29 Jun 2013 23:50:25 +0000 (16:50 -0700)]
Mention of --brightness with -h option
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>
Connor Behan [Wed, 11 Jun 2014 06:56:12 +0000 (23:56 -0700)]
Allow -x and -y switches to undo themselves
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>
Connor Behan [Sun, 1 Jun 2014 23:35:50 +0000 (16:35 -0700)]
Remove duplicate printing of the axis
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>
Dominik Behr [Wed, 2 Apr 2014 01:38:05 +0000 (18:38 -0700)]
xrandr: use full range for gamma table generation
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>
Thomas Klausner [Fri, 28 Mar 2014 23:50:17 +0000 (00:50 +0100)]
Remove unnecessary parentheses.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Aaron Plattner [Thu, 27 Mar 2014 18:37:07 +0000 (11:37 -0700)]
xrandr 1.4.2
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Aaron Plattner [Fri, 21 Mar 2014 17:35:56 +0000 (10:35 -0700)]
xrandr: document how to disconnect RandR 1.4 providers
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>
Dave Airlie [Fri, 3 May 2013 00:05:04 +0000 (10:05 +1000)]
xrandr: allow disconnecting of offload and outputs
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>
Ville Syrjälä [Fri, 31 May 2013 14:01:54 +0000 (17:01 +0300)]
xrandr: Use floating point for VTotal when calculating refresh rate
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>
Ville Syrjälä [Fri, 31 May 2013 14:01:53 +0000 (17:01 +0300)]
xrandr: Use more decimal places when printing various rates
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>
Aaron Plattner [Fri, 3 Jan 2014 13:48:17 +0000 (05:48 -0800)]
Special-case printing of the GUID property
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>
Aaron Plattner [Fri, 3 Jan 2014 13:22:02 +0000 (05:22 -0800)]
Move EDID printing into a helper function
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>
Aaron Plattner [Fri, 3 Jan 2014 13:14:35 +0000 (05:14 -0800)]
Split output property printing into a helper function
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>
Alan Coopersmith [Wed, 17 Jul 2013 06:30:27 +0000 (23:30 -0700)]
xrandr 1.4.1
Alan Coopersmith [Sat, 13 Jul 2013 07:11:41 +0000 (00:11 -0700)]
Combine usage message strings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Alan Coopersmith [Sat, 13 Jul 2013 07:07:26 +0000 (00:07 -0700)]
Declare capability_name() as returning const char *
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>
Thomas [Fri, 9 Nov 2012 14:33:08 +0000 (14:33 +0000)]
Bug 56923 - Make command line options consistent (single vs double dash)
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>
Thomas Klausner [Sun, 2 Jun 2013 19:30:39 +0000 (21:30 +0200)]
Protect config.h like usual.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Andy Ritger [Thu, 2 May 2013 08:20:27 +0000 (01:20 -0700)]
xrandr: calloc XRRModeInfo's passed to libXrandr.
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>
Aaron Plattner [Thu, 28 Feb 2013 20:01:53 +0000 (12:01 -0800)]
Print spaces between XA_ATOM property values
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>
Aaron Plattner [Tue, 12 Feb 2013 21:24:38 +0000 (13:24 -0800)]
xrandr 1.4.0
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Aaron Plattner [Tue, 12 Feb 2013 20:30:20 +0000 (12:30 -0800)]
Merge branch 'fixes'
Conflicts:
xrandr.c
Aaron Plattner [Wed, 6 Feb 2013 22:21:57 +0000 (14:21 -0800)]
Cast XID to unsigned int to suppress a printf warning
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>
Aaron Plattner [Wed, 6 Feb 2013 19:13:06 +0000 (11:13 -0800)]
Bug #37043: adjust refresh rates for doublescan and interlace
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>
Aaron Plattner [Wed, 6 Feb 2013 18:10:03 +0000 (10:10 -0800)]
Bug #29603: document that there might be multiple preferred modes
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>
Aaron Plattner [Wed, 6 Feb 2013 22:11:23 +0000 (14:11 -0800)]
Bug #14118: print usage() to stdout, proper errors for bad arguments
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>
Aaron Plattner [Wed, 6 Feb 2013 21:08:58 +0000 (13:08 -0800)]
Bug #11397: check that numeric --orientation arguments are in range
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>
Aaron Plattner [Sat, 25 Aug 2012 04:43:13 +0000 (21:43 -0700)]
xrandr: Fix variable declaration warnings
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>
Aaron Plattner [Tue, 5 Feb 2013 00:17:24 +0000 (16:17 -0800)]
xrandr: look for providers by name or xid
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>
Aaron Plattner [Tue, 5 Feb 2013 00:05:11 +0000 (16:05 -0800)]
xrandr: make providers a first-class citizen
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>
Aaron Plattner [Mon, 4 Feb 2013 23:20:21 +0000 (15:20 -0800)]
man: document provider options
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>
Alan Coopersmith [Sun, 20 Jan 2013 20:32:15 +0000 (12:32 -0800)]
Fix -Wformat warnings about passing longs where ints were expected
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Alan Coopersmith [Sun, 20 Jan 2013 20:28:04 +0000 (12:28 -0800)]
Mark fatal() and warning() as taking printf-style arguments
Silences -Wformat-nonliteral warnings about them passing through
unknown format arguments to vfprintf.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Alan Coopersmith [Sun, 20 Jan 2013 20:24:24 +0000 (12:24 -0800)]
config: Add missing AC_CONFIG_SRCDIR
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>
Colin Walters [Wed, 16 Jan 2013 18:02:57 +0000 (13:02 -0500)]
autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Adam Jackson <ajax@redhat.com>
Adam Jackson [Wed, 16 Jan 2013 18:03:39 +0000 (13:03 -0500)]
configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Adam Jackson <ajax@redhat.com>
Pierre-Loup A. Griffais [Wed, 19 Dec 2012 20:32:03 +0000 (12:32 -0800)]
xrandr: print primary output
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>
Andy Ritger [Sat, 8 Sep 2012 00:58:46 +0000 (17:58 -0700)]
xrandr: generalize output property printing
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Andy Ritger [Sat, 8 Sep 2012 00:58:45 +0000 (17:58 -0700)]
xrandr: extend '--set' syntax to allow a comma-separated list of values
Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Dave Airlie [Fri, 20 Jan 2012 17:40:41 +0000 (17:40 +0000)]
xrandr: add provider interfaces
This adds an initial interface to list and configure offload and output
providers.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Aaron Plattner [Sat, 25 Aug 2012 04:02:26 +0000 (21:02 -0700)]
xrandr: Fix string constness bugs
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>
Andy Ritger [Fri, 24 Aug 2012 22:53:09 +0000 (15:53 -0700)]
xrandr: compute gamma-correction in [0,2^sigbits)
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>
Andy Ritger [Fri, 24 Aug 2012 22:53:08 +0000 (15:53 -0700)]
xrandr: fix gamma == 1.0 && sigbits != 8
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>
Andy Ritger [Fri, 24 Aug 2012 22:53:07 +0000 (15:53 -0700)]
xrandr: use 1/gamma to compute gamma-correction
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>
Eric S. Raymond [Thu, 23 Aug 2012 16:26:57 +0000 (12:26 -0400)]
Running text interspersed with options prevents DocBook translation; remove.
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>
Keith Packard [Wed, 2 May 2012 04:53:02 +0000 (21:53 -0700)]
keystone.5c: cairo-5 box semantics changed default layout
cairo-5c version 1.6 includes a new 2D box layout widget that
needs widget stretch defined in both dimensions to create
the desired layout.
Signed-off-by: Keith Packard <keithp@keithp.com>
Aaron Plattner [Mon, 23 Apr 2012 19:41:15 +0000 (12:41 -0700)]
Add a --scale-from option
A typical case for wanting to specify a scale on an output is making your
framebuffer be one size and scaling it to fill an output of a different size.
Instead of making the user calculate the scaling factors to be specified by
--scale, add a new option, --scale-from, that lets the user specify the
framebuffer size directly. Compute the appropriate transform to achieve the
desired target size.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Pierre-Loup A. Griffais [Tue, 20 Mar 2012 23:46:22 +0000 (16:46 -0700)]
xrandr: move transform limit checking after scaling
This would trigger for legit scaled matrices, resulting in the wrong
extents getting computed.
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Keith Packard [Wed, 29 Feb 2012 03:26:25 +0000 (16:26 +1300)]
Update keystone program to run with new nichrome bits
Will also work with old nichrome bits.
Signed-off-by: Keith Packard <keithp@keithp.com>
Jeremy Huddleston [Fri, 11 Nov 2011 19:34:38 +0000 (11:34 -0800)]
Include strings.h for strcasecmp
Our minimum requirement for X11 is currently Unix98. Unix98 provides
strcasecmp in <strings.h>. This commit fixes implicit declarations
of this function on systems that closely adhere to the standard.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Keith Packard [Sun, 7 Aug 2011 02:06:42 +0000 (19:06 -0700)]
xrandr: Preserve current mode when switching crtcs
When switching output crtcs, preserve any current mode in preference
to selecting whatever mode is currently in use on that crtc.
Signed-off-by: Keith Packard <keithp@keithp.com>
Adam Jackson [Wed, 20 Jul 2011 18:34:19 +0000 (14:34 -0400)]
Document the rarer --newmode flags in --help output
Signed-off-by: Adam Jackson <ajax@redhat.com>
Alan Coopersmith [Thu, 30 Jun 2011 04:18:23 +0000 (21:18 -0700)]
xrandr 1.3.5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Jeremy Huddleston [Mon, 9 May 2011 16:26:34 +0000 (09:26 -0700)]
find_mode: Search for the mode closes to the specified rate
This was the intention of
d9aeb4a7544ad4a33f6f54bc46bff5cdf231a986, but
find_mode was still picking the first string match rather than the
match with the closest refresh rate.
xrandr.c:740:3: warning: Value stored to 'bestDist' is never read
bestDist = dist;
^ ~~~~
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Jeremy Huddleston [Sun, 8 May 2011 23:42:50 +0000 (16:42 -0700)]
Dead code removal
xrandr.c:2978:33: warning: Value stored to 'first' is never read
if (!first) printf (" "); first = False;
^ ~~~~~
xrandr.c:2966:30: warning: Value stored to 'first' is never read
if (!first) printf (" "); first = False;
^ ~~~~~
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Jeremy Huddleston [Sun, 8 May 2011 23:35:47 +0000 (16:35 -0700)]
Dead code removal
Removing the redundant setting of format = 32 in the XA_ATOM case.
It was already set to that earlier whe it was assigned actual_format.
xrandr.c:2770:3: warning: Value stored to 'format' is never read
format=0;
^ ~
xrandr.c:2782:7: warning: Value stored to 'format' is never read
format = actual_format;
^ ~~~~~~~~~~~~~
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Jeremy Huddleston [Sun, 8 May 2011 23:29:51 +0000 (16:29 -0700)]
Mark usage, fatal, and panic as _X_NORETURN
xrandr.c:634:13: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'output')
output->next = NULL;
~~~~~~ ^
xrandr.c:1214:6: warning: Access to field 'mode' results in a dereference of a null pointer (loaded from variable 'crtc_info')
if (crtc_info->mode == None)
^~~~~~~~~
xrandr.c:1252:5: warning: Array access (via field 'outputs') results in a null pointer dereference
crtc->outputs[crtc->noutput++] = output;
^ ~~~~~~~
xrandr.c:1638:33: warning: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'output_info')
set_name_string (&output_name, output_info->name);
^~~~~~~~~~~
xrandr.c:1725:10: warning: Access to field 'changes' results in a dereference of a null pointer (loaded from variable 'output')
if (output->changes)
^~~~~~
xrandr.c:1848:10: warning: Access to field 'mode_info' results in a dereference of a null pointer (loaded from variable 'relation')
if (relation->mode_info == NULL)
^~~~~~~~
xrandr.c:3194:11: warning: Array access (from variable 'mode_shown') results in a null pointer dereference
if (mode_shown[j]) continue;
^~~~~~~~~~
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Gaetan Nadon [Wed, 19 Jan 2011 15:06:56 +0000 (10:06 -0500)]
config: move man pages into their own directory
Use services provided by XORG_MANPAGE_SECTIONS.
Use standard Makefile for man pages.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Gaetan Nadon [Thu, 13 Jan 2011 22:15:36 +0000 (17:15 -0500)]
man: replace hard coded man page section with substitution strings
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Gaetan Nadon [Thu, 13 Jan 2011 16:15:48 +0000 (11:15 -0500)]
man: remove trailing spaces and tabs
Using s/[ \t]*$//
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Gaetan Nadon [Wed, 12 Jan 2011 21:28:02 +0000 (16:28 -0500)]
config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
This silences an Autoconf warning
Matthias Hopf [Mon, 10 Jan 2011 16:56:16 +0000 (17:56 +0100)]
Add --current to usage.
Alan Coopersmith [Sat, 30 Oct 2010 18:28:41 +0000 (11:28 -0700)]
xrandr 1.3.4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Alan Coopersmith [Sat, 30 Oct 2010 18:26:40 +0000 (11:26 -0700)]
config: Remove unnecessary calls from configure.ac
AC_PROG_CC & AC_PROG_INSTALL are provided by XORG_DEFAULT_OPTIONS now
PKG_CONFIG_MODULES handles AC_SUBST of the CFLAGS & LIBS variables
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Alan Coopersmith [Sat, 30 Oct 2010 18:25:53 +0000 (11:25 -0700)]
config: upgrade to util-macros 1.8 for additional man page support
Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
The value of MAN_SUBST is the same for all X.Org packages.
Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
The existing statement can now be removed from the configuration file.
Use automake provided $(AM_V_GEN) and XORG_DEFAULT_OPTIONS provided $(SED)
Enables silent rule and use platform appropriate version of sed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Gaetan Nadon [Sat, 30 Oct 2010 18:24:14 +0000 (11:24 -0700)]
config: update AC_PREREQ statement to 2.60
Unrelated to the previous patches, the new value simply reflects
the reality that the minimum level for autoconf to configure
all x.org modules is 2.60 dated June 2006.
ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Julien Cristau [Tue, 12 Oct 2010 19:20:18 +0000 (21:20 +0200)]
Call QueryExtension before any other RandR function (bug#30806)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Alan Coopersmith [Thu, 23 Sep 2010 02:39:27 +0000 (19:39 -0700)]
Bug 29348 - dot clock parameter missing from --newmode in man page
https://bugs.freedesktop.org/show_bug.cgi?id=29348
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Julien Cristau [Mon, 19 Jul 2010 17:07:56 +0000 (18:07 +0100)]
Bump to 1.3.3
Julien Cristau [Mon, 19 Jul 2010 17:06:56 +0000 (18:06 +0100)]
Require xorg-macros 1.4 for XORG_INSTALL
Julien Cristau [Mon, 19 Jul 2010 17:05:37 +0000 (18:05 +0100)]
Kill cvs keyword
Eric Piel [Sat, 9 Jan 2010 23:08:53 +0000 (00:08 +0100)]
xrandr: get gamma and brightness
Even in verbose query mode, gamma and brigthness were not displayed.
That's because they are not stored in the server the same way they are
specified on the command line: they are stored as 256 * 3 u16 while
the command line is 3 + 1 floats. Still, this is useful info for the
users, and they don't care about how it's stored in the server.
So we do a regression over the values stored to recover info in the same
way as on the command line: gamma and brightness.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Reviewed-By: Matthias Hopf <mhopf@suse.de>
Eric Piel [Sat, 9 Jan 2010 23:08:53 +0000 (00:08 +0100)]
xrandr: fix maximum gamma set
Gamma is an array of 3 16-bit values. Currently, the maximum value assigned is
255*256, which is only 65280. Make sure that when we set the gamma, the maximum
value is 65535. It's slightly brighter but also helps to avoid kludges to
detect clamped values when reading back the gamma.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Reviewed-by: Matthias Hopf <mhopf@suse.de>
Gaetan Nadon [Thu, 11 Feb 2010 15:08:07 +0000 (10:08 -0500)]
config: move CWARNFLAGS from configure.ac to Makefile.am
Compiler warning flags should be explicitly set in the makefile
rather than being merged with other packages compiler flags.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>