summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-09-18set_gamma_info: remove unnecessary round-trip to serverHEADmasterAlan Coopersmith1-6/+1
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>
2022-12-03xrandr 1.5.2xrandr-1.5.2Alan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-28Constify array argument to find_last_non_clamped()Alan Coopersmith1-1/+1
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>
2022-10-28Remove unused definition of rectangle_tAlan Coopersmith1-4/+0
Was added in commit 854a7c2916455fec5e but never used. Reported by cppcheck unusedStructMember warning. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-28Remove unused macros left over from original RandR 1.2 codeAlan Coopersmith1-13/+0
Use of these was removed in commit cb017692883daf64 in 2006. Reported by clang -Wunused-macros Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-28Fix a -Wsign-compare warningAlan Coopersmith1-1/+1
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>
2022-10-28Variable scope reductions as suggested by cppcheckAlan Coopersmith1-173/+101
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-28gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-09Fix spelling/wording issuesAlan Coopersmith3-3/+3
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-07gitlab CI: add a basic build testAlan Coopersmith1-0/+98
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-08-12xrandr 1.5.1xrandr-1.5.1Matt Turner1-1/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-08-12Build xz tarballs instead of bzip2Matt Turner1-1/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-08-12xrandr: Fix deleting inactive monitorsVladimir Panteleev1-1/+1
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>
2019-03-03xrandr: fix crash if some modes cannot be foundAdam Simpkins1-2/+15
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>
2018-11-21Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-16Update README for gitlab migrationAlan Coopersmith3-27/+19
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-09-13init the name to 0Peter Hutterer1-0/+2
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>
2018-03-24Document that --dpi and --fbmm options set DPI of whole X screenPali Rohár1-4/+15
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>
2018-02-27xrandr: gamma and scaling factors must be positiveGiuseppe Bilotta1-0/+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>
2018-02-27xrandr.man: document the monitor manipulation optionsGiuseppe Bilotta1-0/+23
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-27xrandr: allow single value for --gammaGiuseppe Bilotta2-7/+17
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>
2018-02-27xrandr.man: grammar tuningGiuseppe Bilotta1-5/+6
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>
2018-02-27xrandr: stricter --scale argument parsingGiuseppe Bilotta1-2/+3
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>
2018-02-27xrandr: allow a single value for --scaleGiuseppe Bilotta2-5/+10
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>
2017-06-02man: Document the new --filter optionAaron Plattner1-1/+7
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>
2017-06-01xrandr: Add a "--filter" flagPablo De La Garza1-0/+33
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>
2017-05-29Document format of --dpi option in non-ambiguous wayPali Rohár1-2/+4
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>
2017-03-24xrandr: suppress misleading indentation warningGiuseppe Bilotta1-2/+4
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>
2017-03-24xrandr: document that we accept '--dpi output'Giuseppe Bilotta1-5/+5
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
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>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
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>
2016-02-23xrandr 1.5.0xrandr-1.5.0Aaron Plattner1-1/+1
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2015-10-20Only use the current information when setting modesChris Wilson1-6/+6
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>
2015-07-01Mark all CRTC as currently unused for second picking CRTC passChris Wilson1-0/+13
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>
2015-07-01Mark disabling an output as a change in its CRTCChris Wilson1-1/+1
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>
2015-04-22Split verbose mode printing into a helper functionAaron Plattner1-32/+30
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>
2015-03-31Add monitor support (v2)Keith Packard2-4/+222
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>
2015-03-31xrandr: don't return NULL from a voidDave Airlie1-1/+1
Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-03-30xrandr: parse property returns correctly.Dave Airlie1-29/+54
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>
2014-10-08keystone: Report matrix error. Deal with "primary" in xrandr outputKeith Packard1-15/+101
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>
2014-10-08Increase keystone.5c default window sizeKeith Packard1-1/+1
2014-08-01xrandr 1.4.3xrandr-1.4.3Aaron Plattner1-1/+1
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2014-08-01Merge commit '193a358'Aaron Plattner1-0/+1
Conflicts: xrandr.c
2014-08-01Mention of --brightness with -h optionStéphane Aulery1-0/+1
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>
2014-06-25Allow -x and -y switches to undo themselvesConnor Behan1-2/+7
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>
2014-06-25Remove duplicate printing of the axisConnor Behan1-4/+0
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>
2014-04-30xrandr: use full range for gamma table generationDominik Behr1-18/+7
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>
2014-03-29Remove unnecessary parentheses.Thomas Klausner1-2/+2
Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-03-27xrandr 1.4.2xrandr-1.4.2Aaron Plattner1-1/+1
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>