Add xrandr 1.2.1.

This commit is contained in:
Julien Cristau 2007-06-21 16:23:55 +01:00
parent 61070ccb9e
commit 413f6c501a
5 changed files with 378 additions and 35 deletions

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
x11-xserver-utils (7.2-1) experimental; urgency=low
* Change versioning scheme, base it on the latest X katamari release.
* Add xrandr 1.2.1.
-- Julien Cristau <jcristau@debian.org> Thu, 21 Jun 2007 16:20:45 +0100
x11-xserver-utils (0.1) experimental; urgency=low x11-xserver-utils (0.1) experimental; urgency=low
[ Timo Aaltonen ] [ Timo Aaltonen ]

2
xrandr/aclocal.m4 vendored
View File

@ -159,7 +159,7 @@ path to pkg-config.
_PKG_TEXT _PKG_TEXT
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4]) [$4])
else else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS

24
xrandr/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for xrandr 1.2.0. # Generated by GNU Autoconf 2.61 for xrandr 1.2.1.
# #
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
# #
@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='xrandr' PACKAGE_NAME='xrandr'
PACKAGE_TARNAME='xrandr' PACKAGE_TARNAME='xrandr'
PACKAGE_VERSION='1.2.0' PACKAGE_VERSION='1.2.1'
PACKAGE_STRING='xrandr 1.2.0' PACKAGE_STRING='xrandr 1.2.1'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_subst_vars='SHELL ac_subst_vars='SHELL
@ -1194,7 +1194,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures xrandr 1.2.0 to adapt to many kinds of systems. \`configure' configures xrandr 1.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1264,7 +1264,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of xrandr 1.2.0:";; short | recursive ) echo "Configuration of xrandr 1.2.1:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1359,7 +1359,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
xrandr configure 1.2.0 xrandr configure 1.2.1
generated by GNU Autoconf 2.61 generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1373,7 +1373,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by xrandr $as_me 1.2.0, which was It was created by xrandr $as_me 1.2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@ $ $0 $@
@ -2043,7 +2043,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='xrandr' PACKAGE='xrandr'
VERSION='1.2.0' VERSION='1.2.1'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -3603,7 +3603,7 @@ Alternatively, you may set the environment variables XRANDR_CFLAGS
and XRANDR_LIBS to avoid the need to call pkg-config. and XRANDR_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details. See the pkg-config man page for more details.
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details." >&5 See \`config.log' for more details." >&5
echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full is in your PATH or set the PKG_CONFIG environment variable to the full
@ -3613,7 +3613,7 @@ Alternatively, you may set the environment variables XRANDR_CFLAGS
and XRANDR_LIBS to avoid the need to call pkg-config. and XRANDR_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details. See the pkg-config man page for more details.
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details." >&2;} See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
else else
@ -4239,7 +4239,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by xrandr $as_me 1.2.0, which was This file was extended by xrandr $as_me 1.2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -4292,7 +4292,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\ ac_cs_version="\\
xrandr config.status 1.2.0 xrandr config.status 1.2.1
configured by $0, generated by GNU Autoconf 2.61, configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -22,7 +22,7 @@ dnl
dnl Process this file with autoconf to create configure. dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57]) AC_PREREQ([2.57])
AC_INIT(xrandr,[1.2.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xrandr) AC_INIT(xrandr,[1.2.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xrandr)
AM_INIT_AUTOMAKE([dist-bzip2]) AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE

View File

@ -111,8 +111,17 @@ usage(void)
fprintf(stderr, " --right-of <output>\n"); fprintf(stderr, " --right-of <output>\n");
fprintf(stderr, " --above <output>\n"); fprintf(stderr, " --above <output>\n");
fprintf(stderr, " --below <output>\n"); fprintf(stderr, " --below <output>\n");
fprintf(stderr, " --same-as <output>\n");
fprintf(stderr, " --set <property> <value>\n");
fprintf(stderr, " --off\n"); fprintf(stderr, " --off\n");
fprintf(stderr, " --crtc <crtc>\n"); fprintf(stderr, " --crtc <crtc>\n");
fprintf(stderr, " --newmode <name> <clock MHz>\n");
fprintf(stderr, " <hdisp> <hsync-start> <hsync-end> <htotal>\n");
fprintf(stderr, " <vdisp> <vsync-start> <vsync-end> <vtotal>\n");
fprintf(stderr, " [+HSync] [-HSync] [+VSync] [-VSync]\n");
fprintf(stderr, " --rmmode <name>\n");
fprintf(stderr, " --addmode <output> <mode>\n");
fprintf(stderr, " --delmode <output> <mode>\n");
#endif #endif
exit(1); exit(1);
@ -159,6 +168,7 @@ reflection_name (Rotation rotation)
case RR_Reflect_X|RR_Reflect_Y: case RR_Reflect_X|RR_Reflect_Y:
return "X and Y axis"; return "X and Y axis";
} }
return "invalid reflection";
} }
#if HAS_RANDR_1_2 #if HAS_RANDR_1_2
@ -167,7 +177,7 @@ typedef enum _policy {
} policy_t; } policy_t;
typedef enum _relation { typedef enum _relation {
left_of, right_of, above, below left_of, right_of, above, below, same_as,
} relation_t; } relation_t;
typedef enum _changes { typedef enum _changes {
@ -180,6 +190,7 @@ typedef enum _changes {
changes_reflection = (1 << 5), changes_reflection = (1 << 5),
changes_automatic = (1 << 6), changes_automatic = (1 << 6),
changes_refresh = (1 << 7), changes_refresh = (1 << 7),
changes_property = (1 << 8),
} changes_t; } changes_t;
typedef enum _name_kind { typedef enum _name_kind {
@ -199,6 +210,8 @@ typedef struct {
typedef struct _crtc crtc_t; typedef struct _crtc crtc_t;
typedef struct _output output_t; typedef struct _output output_t;
typedef struct _umode umode_t;
typedef struct _output_prop output_prop_t;
struct _crtc { struct _crtc {
name_t crtc; name_t crtc;
@ -213,11 +226,19 @@ struct _crtc {
int noutput; int noutput;
}; };
struct _output_prop {
struct _output_prop *next;
char *name;
char *value;
};
struct _output { struct _output {
struct _output *next; struct _output *next;
changes_t changes; changes_t changes;
output_prop_t *props;
name_t output; name_t output;
XRROutputInfo *output_info; XRROutputInfo *output_info;
@ -228,6 +249,8 @@ struct _output {
float refresh; float refresh;
XRRModeInfo *mode_info; XRRModeInfo *mode_info;
name_t addmode;
relation_t relation; relation_t relation;
char *relative_to; char *relative_to;
@ -237,6 +260,20 @@ struct _output {
Bool automatic; Bool automatic;
}; };
typedef enum _umode_action {
umode_create, umode_destroy, umode_add, umode_delete
} umode_action_t;
struct _umode {
struct _umode *next;
umode_action_t action;
XRRModeInfo mode;
name_t output;
name_t name;
};
static char *connection[3] = { static char *connection[3] = {
"connected", "connected",
"disconnected", "disconnected",
@ -258,6 +295,7 @@ static char *connection[3] = {
static output_t *outputs = NULL; static output_t *outputs = NULL;
static output_t **outputs_tail = &outputs; static output_t **outputs_tail = &outputs;
static crtc_t *crtcs; static crtc_t *crtcs;
static umode_t *umodes;
static int num_crtcs; static int num_crtcs;
static XRRScreenResources *res; static XRRScreenResources *res;
static int fb_width = 0, fb_height = 0; static int fb_width = 0, fb_height = 0;
@ -412,7 +450,7 @@ find_output (name_t *name)
break; break;
if ((common & name_string) && !strcmp (name->string, output->output.string)) if ((common & name_string) && !strcmp (name->string, output->output.string))
break; break;
if ((common & name_index) & name->index == output->output.index) if ((common & name_index) && name->index == output->output.index)
break; break;
} }
return output; return output;
@ -516,6 +554,15 @@ find_mode_by_xid (RRMode mode)
return find_mode (&mode_name, 0); return find_mode (&mode_name, 0);
} }
static XRRModeInfo *
find_mode_by_name (char *name)
{
name_t mode_name;
init_name (&mode_name);
set_name_string (&mode_name, name);
return find_mode (&mode_name, 0);
}
static static
XRRModeInfo * XRRModeInfo *
find_mode_for_output (output_t *output, name_t *name) find_mode_for_output (output_t *output, name_t *name)
@ -852,8 +899,6 @@ set_crtcs (void)
static Status static Status
crtc_disable (crtc_t *crtc) crtc_disable (crtc_t *crtc)
{ {
XRRCrtcInfo *crtc_info = crtc->crtc_info;
if (verbose) if (verbose)
printf ("crtc %d: disable\n", crtc->crtc.index); printf ("crtc %d: disable\n", crtc->crtc.index);
@ -919,7 +964,7 @@ static void
screen_revert (void) screen_revert (void)
{ {
if (verbose) if (verbose)
printf ("screen %d: revert\n"); printf ("screen %d: revert\n", screen);
if (dryrun) if (dryrun)
return; return;
@ -1183,7 +1228,7 @@ find_crtc_for_output (output_t *output)
for (c = 0; c < output->output_info->ncrtc; c++) for (c = 0; c < output->output_info->ncrtc; c++)
{ {
crtc_t *crtc; crtc_t *crtc;
int l, o; int l;
output_t *other; output_t *other;
crtc = find_crtc_by_xid (output->output_info->crtcs[c]); crtc = find_crtc_by_xid (output->output_info->crtcs[c]);
@ -1242,6 +1287,8 @@ set_positions (void)
if (!(output->changes & changes_relation)) continue; if (!(output->changes & changes_relation)) continue;
if (output->mode_info == NULL) continue;
init_name (&relation_name); init_name (&relation_name);
set_name_string (&relation_name, output->relative_to); set_name_string (&relation_name, output->relative_to);
relation = find_output (&relation_name); relation = find_output (&relation_name);
@ -1282,6 +1329,9 @@ set_positions (void)
output->x = relation->x; output->x = relation->x;
output->y = relation->y + mode_height (relation->mode_info, relation->rotation); output->y = relation->y + mode_height (relation->mode_info, relation->rotation);
break; break;
case same_as:
output->x = relation->x;
output->y = relation->y;
} }
output->changes |= changes_position; output->changes |= changes_position;
any_set = True; any_set = True;
@ -1397,10 +1447,11 @@ main (int argc, char **argv)
int ret = 0; int ret = 0;
#if HAS_RANDR_1_2 #if HAS_RANDR_1_2
output_t *output = NULL; output_t *output = NULL;
char *crtc;
policy_t policy = clone; policy_t policy = clone;
Bool setit_1_2 = False; Bool setit_1_2 = False;
Bool query_1_2 = False; Bool query_1_2 = False;
Bool modeit = False;
Bool propit = False;
Bool query_1 = False; Bool query_1 = False;
int major, minor; int major, minor;
#endif #endif
@ -1600,6 +1651,29 @@ main (int argc, char **argv)
output->changes |= changes_relation; output->changes |= changes_relation;
continue; continue;
} }
if (!strcmp ("--same-as", argv[i])) {
if (++i>=argc) usage ();
if (!output) usage();
output->relation = same_as;
output->relative_to = argv[i];
output->changes |= changes_relation;
continue;
}
if (!strcmp ("--set", argv[i])) {
output_prop_t *prop;
if (!output) usage();
prop = malloc (sizeof (output_prop_t));
prop->next = output->props;
output->props = prop;
if (++i>=argc) usage ();
prop->name = argv[i];
if (++i>=argc) usage ();
prop->value = argv[i];
propit = True;
output->changes |= changes_property;
setit_1_2 = True;
continue;
}
if (!strcmp ("--off", argv[i])) { if (!strcmp ("--off", argv[i])) {
if (!output) usage(); if (!output) usage();
set_name_xid (&output->mode, None); set_name_xid (&output->mode, None);
@ -1649,7 +1723,8 @@ main (int argc, char **argv)
output->automatic = True; output->automatic = True;
output->changes |= changes_automatic; output->changes |= changes_automatic;
} }
automatic = True; else
automatic = True;
setit_1_2 = True; setit_1_2 = True;
continue; continue;
} }
@ -1663,6 +1738,102 @@ main (int argc, char **argv)
query_1 = True; query_1 = True;
continue; continue;
} }
if (!strcmp ("--newmode", argv[i]))
{
umode_t *m = malloc (sizeof (umode_t));
float clock;
++i;
if (i + 9 >= argc) usage ();
m->mode.name = argv[i];
m->mode.nameLength = strlen (argv[i]);
i++;
if (sscanf (argv[i++], "%f", &clock) != 1)
usage ();
m->mode.dotClock = clock * 1e6;
if (sscanf (argv[i++], "%d", &m->mode.width) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.hSyncStart) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.hSyncEnd) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.hTotal) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.height) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.vSyncStart) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.vSyncEnd) != 1) usage();
if (sscanf (argv[i++], "%d", &m->mode.vTotal) != 1) usage();
m->mode.modeFlags = 0;
while (i < argc) {
static const struct {
char *string;
unsigned long flag;
} mode_flags[] = {
{ "+HSync", RR_HSyncPositive },
{ "-HSync", RR_HSyncNegative },
{ "+VSync", RR_VSyncPositive },
{ "-VSync", RR_VSyncNegative },
{ "Interlace", RR_Interlace },
{ "DoubleScan", RR_DoubleScan },
{ "CSync", RR_CSync },
{ "+CSync", RR_CSyncPositive },
{ "-CSync", RR_CSyncNegative },
{ NULL, 0 }
};
int f;
for (f = 0; mode_flags[f].string; f++)
if (!strcasecmp (mode_flags[f].string, argv[i]))
break;
if (!mode_flags[f].string)
break;
m->mode.modeFlags |= mode_flags[f].flag;
i++;
}
m->next = umodes;
m->action = umode_create;
umodes = m;
modeit = True;
continue;
}
if (!strcmp ("--rmmode", argv[i]))
{
umode_t *m = malloc (sizeof (umode_t));
if (++i>=argc) usage ();
set_name (&m->name, argv[i], name_string|name_xid);
m->action = umode_destroy;
m->next = umodes;
umodes = m;
modeit = True;
continue;
}
if (!strcmp ("--addmode", argv[i]))
{
umode_t *m = malloc (sizeof (umode_t));
if (++i>=argc) usage ();
set_name (&m->output, argv[i], name_string|name_xid);
if (++i>=argc) usage();
set_name (&m->name, argv[i], name_string|name_xid);
m->action = umode_add;
m->next = umodes;
umodes = m;
modeit = True;
continue;
}
if (!strcmp ("--delmode", argv[i]))
{
umode_t *m = malloc (sizeof (umode_t));
if (++i>=argc) usage ();
set_name (&m->output, argv[i], name_string|name_xid);
if (++i>=argc) usage();
set_name (&m->name, argv[i], name_string|name_xid);
m->action = umode_delete;
m->next = umodes;
umodes = m;
modeit = True;
continue;
}
#endif #endif
usage(); usage();
} }
@ -1698,17 +1869,134 @@ main (int argc, char **argv)
if (major > 1 || (major == 1 && minor >= 2)) if (major > 1 || (major == 1 && minor >= 2))
has_1_2 = True; has_1_2 = True;
if (has_1_2 && modeit)
{
umode_t *m;
get_screen ();
get_crtcs();
get_outputs();
for (m = umodes; m; m = m->next)
{
XRRModeInfo *e;
output_t *o;
switch (m->action) {
case umode_create:
XRRCreateMode (dpy, root, &m->mode);
break;
case umode_destroy:
e = find_mode (&m->name, 0);
if (!e)
fatal ("cannot find mode \"%s\"\n", m->name.string);
XRRDestroyMode (dpy, e->id);
break;
case umode_add:
o = find_output (&m->output);
if (!o)
fatal ("cannot find output \"%s\"\n", m->output.string);
e = find_mode (&m->name, 0);
if (!e)
fatal ("cannot find mode \"%s\"\n", m->name.string);
XRRAddOutputMode (dpy, o->output.xid, e->id);
break;
case umode_delete:
o = find_output (&m->output);
if (!o)
fatal ("cannot find output \"%s\"\n", m->output.string);
e = find_mode (&m->name, 0);
if (!e)
fatal ("cannot find mode \"%s\"\n", m->name.string);
XRRDeleteOutputMode (dpy, o->output.xid, e->id);
break;
}
}
if (!setit_1_2)
{
XSync (dpy, False);
exit (0);
}
}
if (has_1_2 && propit)
{
get_screen ();
get_crtcs();
get_outputs();
for (output = outputs; output; output = output->next)
{
output_prop_t *prop;
for (prop = output->props; prop; prop = prop->next)
{
Atom name = XInternAtom (dpy, prop->name, False);
Atom type;
int format;
unsigned char *data;
int nelements;
int int_value;
unsigned long ulong_value;
unsigned char *prop_data;
int actual_format;
unsigned long nitems, bytes_after;
Atom actual_type;
XRRPropertyInfo *propinfo;
type = AnyPropertyType;
format=0;
if (XRRGetOutputProperty (dpy, output->output.xid, name,
0, 100, False, False,
AnyPropertyType,
&actual_type, &actual_format,
&nitems, &bytes_after, &prop_data) == Success &&
(propinfo = XRRQueryOutputProperty(dpy, output->output.xid,
name)))
{
type = actual_type;
format = actual_format;
}
if ((type == XA_INTEGER || type == AnyPropertyType) &&
(sscanf (prop->value, "%d", &int_value) == 1 ||
sscanf (prop->value, "0x%x", &int_value) == 1))
{
type = XA_INTEGER;
ulong_value = int_value;
data = (unsigned char *) &ulong_value;
nelements = 1;
format = 32;
}
else if ((type == XA_ATOM))
{
ulong_value = XInternAtom (dpy, prop->value, False);
data = (unsigned char *) &ulong_value;
nelements = 1;
format = 32;
}
else if ((type == XA_STRING || type == AnyPropertyType))
{
type = XA_STRING;
data = (unsigned char *) prop->value;
nelements = strlen (prop->value);
format = 8;
}
XRRChangeOutputProperty (dpy, output->output.xid,
name, type, format, PropModeReplace,
data, nelements);
}
}
if (!setit_1_2)
{
XSync (dpy, False);
exit (0);
}
}
if (setit_1_2) if (setit_1_2)
{ {
XRROutputInfo *output_info;
XRRCrtcInfo *crtc_info;
XRRCrtcInfo *crtc_cur;
XRRModeInfo *mode_info;
RROutput *crtc_outputs;
int n_crtc_output;
int c, o, m;
int om, sm;
get_screen (); get_screen ();
get_crtcs (); get_crtcs ();
get_outputs (); get_outputs ();
@ -1801,6 +2089,9 @@ main (int argc, char **argv)
if (query_1_2 || (query && has_1_2 && !query_1)) if (query_1_2 || (query && has_1_2 && !query_1))
{ {
output_t *output; output_t *output;
int m;
#define ModeShown 0x80000000
get_screen (); get_screen ();
get_crtcs (); get_crtcs ();
@ -1871,7 +2162,7 @@ main (int argc, char **argv)
printf ("\tIdentifier: 0x%x\n", output->output.xid); printf ("\tIdentifier: 0x%x\n", output->output.xid);
printf ("\tTimestamp: %d\n", output_info->timestamp); printf ("\tTimestamp: %d\n", output_info->timestamp);
printf ("\tSubpixel: %s\n", order[output_info->subpixel_order]); printf ("\tSubpixel: %s\n", order[output_info->subpixel_order]);
printf ("\tClones: "); printf ("\tClones: ");
for (j = 0; j < output_info->nclone; j++) for (j = 0; j < output_info->nclone; j++)
{ {
output_t *clone = find_output_by_xid (output_info->clones[j]); output_t *clone = find_output_by_xid (output_info->clones[j]);
@ -1926,7 +2217,7 @@ main (int argc, char **argv)
{ {
printf("\t%s: %d (0x%08x)", printf("\t%s: %d (0x%08x)",
XGetAtomName (dpy, props[j]), XGetAtomName (dpy, props[j]),
*(INT32 *)prop); *(INT32 *)prop, *(INT32 *)prop);
if (propinfo->range && propinfo->num_values > 0) { if (propinfo->range && propinfo->num_values > 0) {
printf(" range%s: ", printf(" range%s: ",
@ -1938,6 +2229,26 @@ main (int argc, char **argv)
} }
printf("\n"); printf("\n");
} else if (actual_type == XA_ATOM &&
actual_format == 32)
{
printf("\t%s: %s",
XGetAtomName (dpy, props[j]),
XGetAtomName (dpy, *(Atom *)prop));
if (!propinfo->range && propinfo->num_values > 0) {
printf("\n\t\tsupported:");
for (k = 0; k < propinfo->num_values; k++)
{
printf(" %-12.12s", XGetAtomName (dpy,
propinfo->values[k]));
if (k % 4 == 3 && k < propinfo->num_values - 1)
printf ("\n\t\t ");
}
}
printf("\n");
} else if (actual_format == 8) { } else if (actual_format == 8) {
printf ("\t\t%s: %s%s\n", XGetAtomName (dpy, props[j]), printf ("\t\t%s: %s%s\n", XGetAtomName (dpy, props[j]),
prop, bytes_after ? "..." : ""); prop, bytes_after ? "..." : "");
@ -1964,6 +2275,7 @@ main (int argc, char **argv)
printf (" v: height %4d start %4d end %4d total %4d clock %6.1fHz\n", printf (" v: height %4d start %4d end %4d total %4d clock %6.1fHz\n",
mode->height, mode->vSyncStart, mode->vSyncEnd, mode->vTotal, mode->height, mode->vSyncStart, mode->vSyncEnd, mode->vTotal,
mode_refresh (mode)); mode_refresh (mode));
mode->modeFlags |= ModeShown;
} }
} }
else else
@ -1985,6 +2297,7 @@ main (int argc, char **argv)
kmode = find_mode_by_xid (output_info->modes[k]); kmode = find_mode_by_xid (output_info->modes[k]);
if (strcmp (jmode->name, kmode->name) != 0) continue; if (strcmp (jmode->name, kmode->name) != 0) continue;
mode_shown[k] = True; mode_shown[k] = True;
kmode->modeFlags |= ModeShown;
printf (" %6.1f", mode_refresh (kmode)); printf (" %6.1f", mode_refresh (kmode));
if (kmode == output->mode_info) if (kmode == output->mode_info)
printf ("*"); printf ("*");
@ -2000,6 +2313,23 @@ main (int argc, char **argv)
free (mode_shown); free (mode_shown);
} }
} }
for (m = 0; m < res->nmode; m++)
{
XRRModeInfo *mode = &res->modes[m];
if (!(mode->modeFlags & ModeShown))
{
printf (" %s (0x%x) %6.1fMHz\n",
mode->name, mode->id,
(float)mode->dotClock / 1000000.0);
printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.1fKHz\n",
mode->width, mode->hSyncStart, mode->hSyncEnd,
mode->hTotal, mode->hSkew, mode_hsync (mode) / 1000);
printf (" v: height %4d start %4d end %4d total %4d clock %6.1fHz\n",
mode->height, mode->vSyncStart, mode->vSyncEnd, mode->vTotal,
mode_refresh (mode));
}
}
exit (0); exit (0);
} }
#endif #endif
@ -2027,6 +2357,12 @@ main (int argc, char **argv)
} }
else if (size < 0) else if (size < 0)
size = current_size; size = current_size;
else if (size >= nsize) {
fprintf (stderr,
"Size index %d is too large, there are only %d sizes\n",
size, nsize);
exit (1);
}
if (rot < 0) if (rot < 0)
{ {
@ -2051,7 +2387,7 @@ main (int argc, char **argv)
if (rate == rates[i]) if (rate == rates[i])
break; break;
if (i == nrate) { if (i == nrate) {
fprintf (stderr, "Rate %d not available for this size\n", rate); fprintf (stderr, "Rate %.1f Hz not available for this size\n", rate);
exit (1); exit (1);
} }
} }
@ -2063,7 +2399,7 @@ main (int argc, char **argv)
major_version, minor_version); major_version, minor_version);
} }
if (query) { if (query || query_1) {
printf(" SZ: Pixels Physical Refresh\n"); printf(" SZ: Pixels Physical Refresh\n");
for (i = 0; i < nsize; i++) { for (i = 0; i < nsize; i++) {
printf ("%c%-2d %5d x %-5d (%4dmm x%4dmm )", printf ("%c%-2d %5d x %-5d (%4dmm x%4dmm )",