Yes, two changes in one commit. Sorry 'bout that.
The first change ensures that when pending property values have been
changed, a mode set to the current mode will actually do something, rather
than being identified as a no-op. In addition, the driver no longer needs to
manage the migration of pending to current values, that is handled both
within the xf86 mode setting code (to deal with non-RandR changes) as well
as within the RandR extension itself.
The second change eliminates the two-call Create/AttachScreen stuff that was
done in a failed attempt to create RandR resources before the screen
structures were allocated. Merging these back into the Create function is
cleaner.
(cherry picked from commit 57e87e0d00)
Conflicts:
randr/randrstr.h
randr/rrcrtc.c
I think master and server-1.3-branch are more in sync now.
desiredX and desiredY were not recorded during xf86InitialConfiguration.
desiredX, desiredY and desiredRotation were not recorded during
xf86SetSingleMode.
(cherry picked from commit 36e5227215)
Pending Properties take effect when the driver says they do, so provide an
API to tell DIX when a property effect is made. Also, allow driver
to reject property values in RRChangeOutputProperty.
(cherry picked from commit 8eb288fbd6)
The rotation state is stored in the xf86_config structure which is not
re-initialized at server reset time. Clean it up at CloseScreen time.
(cherry picked from commit f8db7665dc)
The xf86 mode setting code was mis-using this field to try and store a
pointer to a DisplayModeRec, however, each output has its own copy of every
DisplayModeRec leaving the one in in the RRModeRec devPrivate field pointing
at a random DisplayModeRec.
Instead of attempting to rectify this, eliminating the devPrivate entirely
turned out to be very easy; the DDX code now accepts an arbitrary RRModeRec
structure and set that to the hardware, converting it on the fly to a
DisplayModeRec as needed.
(cherry picked from commit 3506b9376c)
The RandR protocol spec has several requests in support of user-defined
modes, but the implementation was stubbed out inside the X server. Fill out
the DIX portion and start on the xf86 DDX portion. It might be necessary to
add more code to the DDX to insert the user-defined modes into the output
mode list.
(cherry picked from commit 63cc2a51ef)
Conflicts:
randr/randrstr.h
Updated code to work in master with recent security API changes.
Rotation block handler was re-registering the rotation damage structure,
creating an infinite loop in the damage code. Track registration of the
damage structure to avoid this.
(cherry picked from commit b14f003b0e)
xf86_reload_cursors is supposed to be called from the crtc mode setting
commit hook; as that happens during server initialization, check for this
case.
(cherry picked from commit 5b77bf2d02)
This moves most of the cursor management code out of the intel driver and
into the general server code. Of course, the hope is that this code will be
useful for other driver writers as well.
Check out xf86Crtc.h for the usage information, making sure you add the
needed hooks to the crtc funcs structure for your driver.
(cherry picked from commit 4d81c99a46)
Previous version used monitor identifiers if present, otherwise output
names. That caused existing working configurations to break when additional
information was added to the configuration file.
(cherry picked from commit 3f5cedf00a)
Screen physical size is set to a random value before the RandR code gets
control, override that and reset it to a value based on the compat_output
physical size (if available). If that output has no physical size, just use
96dpi as the default resolution and set the physical size as appropriate.
(cherry picked from commit 843077f23a)
xf86SetDesiredModes applies the desired modes to each crtc (as selected by
xf86InitialConfiguration initially and modified by successful mode settings
afterwards). For crtcs without a desired mode, pScrn->currentMode is used to
select something workable.
(cherry picked from commit bcade98cca)
This function applies a single mode to the screen (as from RandR 1.1,
XFree86-VidModeExtension or XFree86-DGA) using a policy that selects one
output to reconfigure to the requested mode and then makes all other outputs
fit within that size.
(cherry picked from commit 5a595c1f76)
Box transformation from source to dest area was broken, leaving the wrong
areas painted when the crtc origin was non-zero.
When rotating from left to right, the pixmap doesn't get reallocated, and so
no damage was left in the pixmap from xf86RotatePrepare. Separately damage
the whole crtc area when this occurs to repaint the area.
(cherry picked from commit 2a50ca2160)
canGrow indicates to the DDX that the driver can enlarge the desktop via the
xf86_config->funcs->resize hook. If so, xf86InitialConfiguration will set
virtual[XY] to match the configuration it chooses and will leave the crtc config
size ranges alone. If FALSE, it will bloat the screen to fit the largest probed
mode and also set the crtc config max size to limit the desktop to the initial
virtual[XY] size.
This hook is called when the DDX needs to resize the screen. The driver is
responsible for changing virtualX and virtualY, along with any other related
screen properties (devPrivate.ptr, devKind, displayWidth, etc.).
Use the size range from the crtc config instead of randrp->virtual[XY] when
reporting the min and max screen sizes to the DDX.
in xf86CrtcSetMode, scrn->pScreen will be NULL during server startup time,
so don't try to set the subpixel order. subpixel order will be set in the
randr initialization anyways.
(cherry picked from commit 5f6f8616d8)
New modes header files required a few minor changes to be used by external
drivers, the most notable of which is the publication of the config file
parser header files.
Add monitor "Rotate" option taking one of "normal", "left", "inverted" or
"right". However, because initial mode selection is made before the screen
is completely initialized, we cannot create the shadow pixmap object at this
point. Pend the shadow pixmap creation until the block handler.
Note that this code is not completely functional yet.
Code added in hw/xfree86/modes came from the server-1.3-branch.
Portions of this code had previously been integrated into xf86Mode.c
and edid_modes.c.
To preserve hw/xfree86/modes as much as possible, the duplicate code from
the other files has been disabled; a more careful review would figure out
where that code actually belonged.
RandR 1.0 sizeID must be computed the same way every time, so when reporting
it in the ScreenChangeNotify event, just construct the usual 1.0 data block
and use that.
subpixel geometry information can be computed by looking at the connected
outputs and finding any with subpixel geometry and using one of those for
the global screen subpixel geometry. This might be improved by reporting
None if more than one screen has information and they conflict.
This code comes from the intel driver, so there's no history in this tree.
As the crtc/output-based mode selection code uses ddc, the ddc and i2c
modules have been merged into the server. Attempts to load them are safely
ignored now.