Age | Commit message (Collapse) | Author | Files | Lines |
|
XRRGetCrtcGamma() returns the exact same size information as
XRRGetCrtcGammaSize(), so just use it instead of waiting for
the X server to send it an extra time.
(And if something has gone very wrong so that they aren't the same,
this avoids out-of-bounds reads processing the returned gamma arrays
by using the size of the arrays we allocated.)
Reported-by: Gregory James DUCK <gjduck@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Suggested by cppcheck:
xrandr.c:1046:30: style: Parameter 'array' can be declared with const [constParameter]
find_last_non_clamped(CARD16 array[], int size)
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Was added in commit 854a7c2916455fec5e but never used.
Reported by cppcheck unusedStructMember warning.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Use of these was removed in commit cb017692883daf64 in 2006.
Reported by clang -Wunused-macros
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
xrandr.c: In function ‘main’:
xrandr.c:2780:24: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
for (int t = 0; t < sizeof(filter_names) / sizeof(filter_names[0]); t++)
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
The following commands did not behave correctly:
xrandr --setmonitor empty auto none
xrandr --delmonitor empty
The second command failed with "No monitor named 'empty'". This
occurred because get_monitors was invoked with its get_active argument
set to False, which caused it to not retrieve inactive monitors. Thus,
inactive monitors could not be deleted.
Fix this bug by invoking get_monitors (and, thus, XRRGetMonitors) with
get_active = False, thus enabling deletion of disabled monitors.
Signed-off-by: Matt Turner <mattst88@gmail.com>
|
|
When printing modes in "xrandr -q", check to see if we failed to look up
mode information from a mode XID. Previously the command would
dereference null and crash if the mode information could not be found.
When using an external HDMI monitor on a laptop with a Skylake Intel
graphics chipset "xrandr -q" occasionally is unable to look up mode
information for some of the modes. It seems likely there is some other
sort of library or driver issue causing these lookup failures, but this
change to xrandr at least prevents it from segfaulting.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
There are a few conditions where coverity finds a use of an uninitialized
field of the name_t struct. These are rather messy combinations of conditions,
so let's go with the simple solution here and just init everything to 0.
This may still have side-effects but at least they'll be more obvious than the
previous "use whatever memory is leftover from breakfast".
This patch also adds a missing init_name(), much for the same reason.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Explicitly document and make it clear that those options do not change
DPI of some monitor output. Also state that these options have no useful
meaning for multi-monitor configuration.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
|
|
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
Similarly to --scale, accept a single value to be used for all three
components, and refuse values with extra junk after the acceptable
values.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
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>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
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>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
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>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
|
|
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
|
|
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>
|
|
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>
|
|
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
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>
|
|
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>
|