xorg/xrandr
11 years agoxrandr 1.4.0 xrandr-1.4.0
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>
11 years agoMerge branch 'fixes'
Aaron Plattner [Tue, 12 Feb 2013 20:30:20 +0000 (12:30 -0800)] 
Merge branch 'fixes'

Conflicts:
xrandr.c

11 years agoCast XID to unsigned int to suppress a printf warning
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>
11 years agoBug #37043: adjust refresh rates for doublescan and interlace
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>
11 years agoBug #29603: document that there might be multiple preferred modes
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>
11 years agoBug #14118: print usage() to stdout, proper errors for bad arguments
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>
11 years agoBug #11397: check that numeric --orientation arguments are in range
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>
11 years agoxrandr: Fix variable declaration warnings
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>
11 years agoxrandr: look for providers by name or xid
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>
11 years agoxrandr: make providers a first-class citizen
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>
11 years agoman: document provider options
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>
11 years agoFix -Wformat warnings about passing longs where ints were expected
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>
11 years agoMark fatal() and warning() as taking printf-style arguments
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>
11 years agoconfig: Add missing AC_CONFIG_SRCDIR
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>
11 years agoautogen.sh: Honor NOCONFIGURE=1
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>
11 years agoconfigure: Drop AM_MAINTAINER_MODE
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>
11 years agoxrandr: print primary output
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>
11 years agoxrandr: generalize output property printing
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>
11 years agoxrandr: extend '--set' syntax to allow a comma-separated list of values
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>
11 years agoxrandr: add provider interfaces
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>
11 years agoxrandr: Fix string constness bugs
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>
11 years agoxrandr: compute gamma-correction in [0,2^sigbits)
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>
11 years agoxrandr: fix gamma == 1.0 && sigbits != 8
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>
11 years agoxrandr: use 1/gamma to compute gamma-correction
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>
11 years agoRunning text interspersed with options prevents DocBook translation; remove.
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>
11 years agokeystone.5c: cairo-5 box semantics changed default layout
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>
11 years agoAdd a --scale-from option
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>
12 years agoxrandr: move transform limit checking after scaling
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>
12 years agoUpdate keystone program to run with new nichrome bits
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>
12 years agoInclude strings.h for strcasecmp
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>
12 years agoxrandr: Preserve current mode when switching crtcs
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>
12 years agoDocument the rarer --newmode flags in --help output
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>
12 years agoxrandr 1.3.5 xrandr-1.3.5
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>
12 years agofind_mode: Search for the mode closes to the specified rate
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>
12 years agoDead code removal
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>
12 years agoDead code removal
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>
12 years agoMark usage, fatal, and panic as _X_NORETURN
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>
13 years agoconfig: move man pages into their own directory
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>
13 years agoman: replace hard coded man page section with substitution strings
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>
13 years agoman: remove trailing spaces and tabs
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>
13 years agoconfig: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
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

13 years agoAdd --current to usage.
Matthias Hopf [Mon, 10 Jan 2011 16:56:16 +0000 (17:56 +0100)] 
Add --current to usage.

13 years agoxrandr 1.3.4 xrandr-1.3.4
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>
13 years agoconfig: Remove unnecessary calls from configure.ac
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>
13 years agoconfig: upgrade to util-macros 1.8 for additional man page support
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>
13 years agoconfig: update AC_PREREQ statement to 2.60
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>
13 years agoCall QueryExtension before any other RandR function (bug#30806)
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>
13 years agoBug 29348 - dot clock parameter missing from --newmode in man page
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>
13 years agoBump to 1.3.3 xrandr-1.3.3
Julien Cristau [Mon, 19 Jul 2010 17:07:56 +0000 (18:07 +0100)] 
Bump to 1.3.3

13 years agoRequire xorg-macros 1.4 for XORG_INSTALL
Julien Cristau [Mon, 19 Jul 2010 17:06:56 +0000 (18:06 +0100)] 
Require xorg-macros 1.4 for XORG_INSTALL

13 years agoKill cvs keyword
Julien Cristau [Mon, 19 Jul 2010 17:05:37 +0000 (18:05 +0100)] 
Kill cvs keyword

14 years agoxrandr: get gamma and brightness
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>
14 years agoxrandr: fix maximum gamma set
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>
14 years agoconfig: move CWARNFLAGS from configure.ac to Makefile.am
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>
14 years agoxrandr: fix brightness to prevent gamma to overflow and to allow 0
Éric Piel [Wed, 6 Jan 2010 13:42:15 +0000 (14:42 +0100)] 
xrandr: fix brightness to prevent gamma to overflow and to allow 0

With the new brightness option, gamma would overflow with values > 1,
leading to rainbow looking screen.

In addition, have the brightness by default to 1, so that specifying 0
actually does the expected behaviour of leading to a black screen.

Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Reviewed-by: Matthias Hopf <mhopf@suse.de>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
14 years agoxrandr: Remove --clone / --extend support code
Yann Droneaud [Tue, 17 Nov 2009 14:39:02 +0000 (15:39 +0100)] 
xrandr: Remove --clone / --extend support code

Code handling --clone and --extend is not used.
The usage message regarding those options was already commented out.

Signed-off-by: Yann Droneaud <ydroneaud@mandriva.com>
Acked-by: Matthias Hopf <mhopf@suse.de>
14 years agoLanguage fixes.
Matthias Hopf [Tue, 5 Jan 2010 13:58:42 +0000 (14:58 +0100)] 
Language fixes.

14 years agoxrandr: Use a prefix for enum type _policy and _relation like other enums in xrandr.c
Yann Droneaud [Tue, 17 Nov 2009 14:39:01 +0000 (15:39 +0100)] 
xrandr: Use a prefix for enum type _policy and _relation like other enums in xrandr.c

Try to apply the same coding style to enum _policy and enum _relation.

This patch also workarounds bug #12958 .

Signed-off-by: Yann Droneaud <ydroneaud@mandriva.com>
Acked-by: Matthias Hopf <mhopf@suse.de>
14 years agoAdd --brightness for CRTC
Mikhail Gusarov [Sat, 24 Oct 2009 21:41:05 +0000 (03:41 +0600)] 
Add --brightness for CRTC

--brightness n.m adjusts gamma set for CRTC in order to compensate
for overly bright or overly dark unmanageable outputs.

Signed-off-by: Matthias Hopf <mhopf@suse.de>
14 years agoxrandr: add more information about the transform option in the manpage
Matthias Hopf [Sat, 2 Jan 2010 23:40:19 +0000 (00:40 +0100)] 
xrandr: add more information about the transform option in the manpage

Add information about the transformation, stating it's a homogeneous
coordinate transformation and adding the (simplified) pixel calculation
formula. Also and an example of keystone shaping generated using the algorithm
found in xkeystone.

Based on a patch by Eric Piel <eric.piel@tremplin-utc.net>

Signed-off-by: Matthias Hopf <mhopf@suse.de>
14 years agoxrandr: check_strtod should return double, not int
Dominik Jasiok [Tue, 22 Dec 2009 18:48:04 +0000 (10:48 -0800)] 
xrandr: check_strtod should return double, not int

check_strtod performs error checking around strtod to ensure that
arguments are correctly processed. However, it also accidentally(?)
cast the result to int, which was then universally cast back to double
by all callers. Narrowing and re-widening the type doesn't make any sense.

Signed-off-by: Keith Packard <keithp@keithp.com>
14 years agoMakefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
Gaetan Nadon [Thu, 26 Nov 2009 14:19:54 +0000 (09:19 -0500)] 
Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES

Now that the INSTALL file is generated.
Allows running make maintainer-clean.

14 years agoINSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
Gaetan Nadon [Wed, 28 Oct 2009 18:09:08 +0000 (14:09 -0400)] 
INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206

Add missing INSTALL file. Use standard GNU file on building tarball
README may have been updated
Remove AUTHORS file as it is empty and no content available yet.
Remove NEWS file as it is empty and no content available yet.

14 years agoDeploy the new XORG_DEFAULT_OPTIONS #24242
Gaetan Nadon [Tue, 27 Oct 2009 19:07:25 +0000 (15:07 -0400)] 
Deploy the new XORG_DEFAULT_OPTIONS #24242

This macro aggregate a number of existing macros that sets commmon
X.Org components configuration options. It shields the configuration file from
future changes.

14 years agoMakefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
Gaetan Nadon [Tue, 27 Oct 2009 02:08:39 +0000 (22:08 -0400)] 
Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432

ChangeLog filename is known to Automake and requires no further
coding in the makefile.

14 years ago.gitignore: use common defaults with custom section # 24239
Gaetan Nadon [Thu, 22 Oct 2009 16:34:16 +0000 (12:34 -0400)] 
.gitignore: use common defaults with custom section # 24239

Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.

14 years agoxrandr: Remove test against RANDR_MAJOR/RANDR_MINOR
Yann Droneaud [Tue, 17 Nov 2009 09:34:41 +0000 (10:34 +0100)] 
xrandr: Remove test against RANDR_MAJOR/RANDR_MINOR

xrandr.c uses structures defined in <X11/extensions/Xrandr.h>
provided by 'libXrandr' package but tests structures availability
through RANDR_MAJOR/RANDR_MINOR defined in <X11/extensions/randr.h>
provided by 'randrproto' package.

Sometimes they are not in sync so it's safer to rely on checks made
by configure script through pkg-config.

In my test case, XRRPanning structure is not defined in Xrandr.h,
RANDR_MAJOR is 1 and RANDR_MINOR 2 but xrandr.c try to use it anyway.
(for the record, XRRPanning was added in libXrandr-1.2.91).

Signed-off-by: Yann Droneaud <ydroneaud@mandriva.com>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
14 years agoxrandr: do not segfault when "--scale" or "--transform" have no output
Éric Piel [Mon, 26 Oct 2009 13:11:02 +0000 (14:11 +0100)] 
xrandr: do not segfault when "--scale" or "--transform" have no output

"xrandr --scale 2x2" segfaults, because the --scale (and --transform)
options do not check for an existing output.

Make sure there is an output specified (like every other options).

Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Matthias Hopf <mhopf@suse.de>
14 years agoxrandr: make --query really the default option
Éric Piel [Mon, 26 Oct 2009 12:57:10 +0000 (13:57 +0100)] 
xrandr: make --query really the default option

The manpage states that "--query" is the default action when nothing
specific is requested. However, some options such as "-display" or
"--screen" lead to do nothing by default. This makes sure that unless
something specific is requested, query is done.

This also restores the behaviour of --q1 to the same one as the old
xrandr: also display the info on rotation and reflection by default.

Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Matthias Hopf <mhopf@suse.de>
14 years agoThis is not a GNU project, so declare it foreign.
Jeremy Huddleston [Wed, 21 Oct 2009 19:47:21 +0000 (12:47 -0700)] 
This is not a GNU project, so declare it foreign.

On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
> On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
> > I noticed an INSTALL file in xlsclients and libXvMC today, and it
> > was quite annoying to work around since 'autoreconf -fvi' replaces
> > it and git wants to commit it.  Should these files even be in git?
> > Can I nuke them for the betterment of humanity and since they get
> > created by autoreconf anyways?
>
> See https://bugs.freedesktop.org/show_bug.cgi?id=24206

As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
of the INSTALL file. It is also part of the 24206 solution.

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
14 years agoAdd README with pointers to mailing lists, bugzilla, & git
Alan Coopersmith [Thu, 1 Oct 2009 21:54:29 +0000 (14:54 -0700)] 
Add README with pointers to mailing lists, bugzilla, & git

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
14 years agoBump to 1.3.2 xrandr-1.3.2
Matthias Hopf [Thu, 10 Sep 2009 11:18:35 +0000 (13:18 +0200)] 
Bump to 1.3.2

14 years agoAdd missing 'static's to get rid of warnings.
Matthias Hopf [Thu, 10 Sep 2009 11:17:56 +0000 (13:17 +0200)] 
Add missing 'static's to get rid of warnings.

14 years agochanged a bunch of string to number conversions for reliability
Bart Massey [Thu, 7 Feb 2008 22:03:24 +0000 (14:03 -0800)] 
changed a bunch of string to number conversions for reliability

14 years agoWarn if one of the outputs given did not exist
Bart Massey [Fri, 4 Sep 2009 13:36:51 +0000 (15:36 +0200)] 
Warn if one of the outputs given did not exist

14 years agoBump to 1.3.1 xrandr-1.3.1
Matthias Hopf [Tue, 11 Aug 2009 14:11:39 +0000 (16:11 +0200)] 
Bump to 1.3.1

Also finally bump xrandr requirement to 1.3

14 years agobfo#22864 - grab the server around all modifications to CRTCs
Federico Mena Quintero [Mon, 20 Jul 2009 21:44:52 +0000 (16:44 -0500)] 
bfo#22864 - grab the server around all modifications to CRTCs

We were not grabbed while disabling the CRTCs that should be off, so other clients could think
that there was an intermediate stage with no enabled outputs.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
14 years agoxrandr: Document --nograb option
Éric Piel [Tue, 14 Jul 2009 19:36:32 +0000 (21:36 +0200)] 
xrandr: Document --nograb option

Op 08-07-09 15:19, Matthias Hopf schreef:
> On Jul 07, 09 22:02:51 +0200, Éric Piel wrote:
>> Op 21-05-09 13:23, Éric Piel schreef:
>>> This documents the --nograb option with whichever I could understand of
>>> the advantages and drawbacks of grabbing the screen.
>>>
>>> Also fixes the formatting in the xrandr 1.3 options.
>> Please review and apply.
>
> Please resend as attachment.
>
Please find attached the git patch.

Thanks,
Eric

>From 34e7c1036ba0e0d7827563deaffea9371031fa0b Mon Sep 17 00:00:00 2001
From: Eric Piel <eric.piel@tremplin-utc.net>
Date: Thu, 21 May 2009 13:01:52 +0200
Subject: [PATCH] xrandr: Document --nograb option

This documents the --nograb option with whichever I could understand of
the advantages and drawback of grabbing the screen.

Also fixes the formatting in the xrandr 1.3 options

14 years agoFix missing prototype warning.
Matthias Hopf [Mon, 6 Jul 2009 16:30:05 +0000 (18:30 +0200)] 
Fix missing prototype warning.

14 years agoReport program version as well with --version.
Matthias Hopf [Mon, 6 Jul 2009 16:28:23 +0000 (18:28 +0200)] 
Report program version as well with --version.

This has bitten us too often already (the infamous uncloning bug).

15 years agoxrandr 1.3.0 xrandr-1.3.0
Adam Jackson [Wed, 1 Apr 2009 15:03:10 +0000 (11:03 -0400)] 
xrandr 1.3.0

15 years agoAllow zero replies from GetPanning to mean panning is unavailable.
Adam Jackson [Tue, 17 Feb 2009 18:45:32 +0000 (13:45 -0500)] 
Allow zero replies from GetPanning to mean panning is unavailable.

15 years agoSet the screen config on the correct screen.
Aaron Plattner [Wed, 4 Mar 2009 23:49:10 +0000 (15:49 -0800)] 
Set the screen config on the correct screen.

Otherwise, "DISPLAY=:0.0 xrandr --screen 1 -s 1" fails.

15 years agoRevert "Move outputs among crtcs as necessary. Fixes 14570"
Matthias Hopf [Fri, 6 Mar 2009 13:49:43 +0000 (14:49 +0100)] 
Revert "Move outputs among crtcs as necessary. Fixes 14570"

This reverts commit 4dcc8ae1a6903434def1a2706f7c68ff9e2a17c4.
The commit broke uncloning completely again.

Conflicts:

xrandr.c

15 years agoBump to 1.2.99.4 xrandr-1.2.99.4
Julien Cristau [Sun, 1 Feb 2009 13:39:30 +0000 (14:39 +0100)] 
Bump to 1.2.99.4

15 years agoDocument the --primary and --noprimary options
Julien Cristau [Sun, 1 Feb 2009 13:34:15 +0000 (14:34 +0100)] 
Document the --primary and --noprimary options

15 years agoDocument the --current option
Julien Cristau [Sun, 1 Feb 2009 13:12:21 +0000 (14:12 +0100)] 
Document the --current option

15 years agoAdd --noprimary option
Keith Packard [Sat, 31 Jan 2009 04:37:34 +0000 (20:37 -0800)] 
Add --noprimary option

15 years agoAdd --primary option
Keith Packard [Sat, 31 Jan 2009 04:11:10 +0000 (20:11 -0800)] 
Add --primary option

Signed-off-by: Keith Packard <keithp@keithp.com>
15 years agoAdd --nograb option
Keith Packard [Sat, 31 Jan 2009 04:11:02 +0000 (20:11 -0800)] 
Add --nograb option

Signed-off-by: Keith Packard <keithp@keithp.com>
15 years agoAdd --current option to use new XRRGetScreenResourcesCurrent API
Keith Packard [Wed, 10 Dec 2008 05:26:50 +0000 (21:26 -0800)] 
Add --current option to use new XRRGetScreenResourcesCurrent API

Signed-off-by: Keith Packard <keithp@keithp.com>
15 years agoSeveral fatal() were missing \n.
Matthias Hopf [Fri, 30 Jan 2009 16:46:05 +0000 (17:46 +0100)] 
Several fatal() were missing \n.

15 years agoAdd docs for --transform and --scale.
Éric Piel [Mon, 19 Jan 2009 15:18:46 +0000 (16:18 +0100)] 
Add docs for --transform and --scale.

The new --transform and --scale options were added, but not yet
documented. This includes also an example of usage of panning and
scaling at the same time.

15 years agoCorrect make distcheck and gcc/sparse warnings.
Paulo Cesar Pereira de Andrade [Mon, 26 Jan 2009 18:40:59 +0000 (16:40 -0200)] 
Correct make distcheck and gcc/sparse warnings.

15 years agoStay away from doublescan modes unless a refresh rate is specified.
Maarten Maathuis [Mon, 5 Jan 2009 18:47:21 +0000 (19:47 +0100)] 
Stay away from doublescan modes unless a refresh rate is specified.

15 years agoFix gamma computation.
Maarten Maathuis [Mon, 22 Dec 2008 18:46:24 +0000 (19:46 +0100)] 
Fix gamma computation.

- The previous version sometimes overflowed.

15 years agoPrint multiple Atom and INT32 properties.
Matthias Hopf [Thu, 18 Dec 2008 15:09:39 +0000 (16:09 +0100)] 
Print multiple Atom and INT32 properties.

Improve output formating of strings.

15 years agorandr-1.2: support gamma changes.
Maarten Maathuis [Wed, 17 Dec 2008 16:18:14 +0000 (17:18 +0100)] 
randr-1.2: support gamma changes.

15 years agoBump to 1.2.99.3 xrandr-1.2.99.3
Matthias Hopf [Mon, 15 Dec 2008 19:39:43 +0000 (20:39 +0100)] 
Bump to 1.2.99.3

15 years agoAdd keystone.5c to EXTRA_DIST
Matthias Hopf [Mon, 15 Dec 2008 20:00:55 +0000 (21:00 +0100)] 
Add keystone.5c to EXTRA_DIST