Commit Graph

242 Commits

Author SHA1 Message Date
Keith Packard
4302a32391 Make crtc_notify wrap/unwrap code do nothing unless mode code is inuse
Drivers not using the new hw/xfree86/modes code would crash in DRI due to
that code trying to monitor CRTC changes.

(cherry picked from commit ea309e4745)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17 19:07:13 -08:00
Keith Packard
536748aa88 Merge branch 'panning-for-server-1.6' into server-1.6-branch 2009-02-17 18:52:04 -08:00
Keith Packard
791c6eccee Handle the combination of panning and crtc transforms
This patch gets the shadow scanout buffer repainted on panning area changes.
It does not, however, track the mouse correctly.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7968823cbc)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17 14:43:25 -08:00
Keith Packard
099d74a127 Damage re-used shadow scanout buffer using new transforms.
When the shadow scanout buffer can be re-used, the underlying framebuffer
area must be damaged so that the scanout will be repainted. This patch
delays the addition of that damaged area until after the transform in the
crtc has been updated, otherwise the old transform would have been used and
the wrong area repainted.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 763df9eec7)

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17 14:43:25 -08:00
Xiang, Haihao
ef796a95dd avoid a potential endless loop.
Previously it is possible that creating rotation data, then cleaning
up and creating again so that pScreen->BlockHandler and
xf86_config->BlockHandler all point to xf86RotateBlockHandler.
See bug #19343.
(cherry picked from commit 5f3188228e)
2009-01-30 16:56:09 -08:00
Maarten Maathuis
ffdf013905 randr/xfree86: Fix a one off error in the panning calculations.
- Example: mode 1280x1024, panned area 1281x1024
           panned_area.x2 = 1281
           mode.width = 1280
  If you substract 1280 from 1281, then that leaves you with one.
  Which is the one pixel that you need to move to actually see the last pixel collumn.
  Substracting 1 from this will consistently prevent you from seeing the right and bottom edge.
(cherry picked from commit aedd2f566d)
2009-01-09 10:59:05 -08:00
Cooper Yuan
75bad86992 Fix typo in xf86PickCrtcs()
(cherry picked from commit 2a61397d17)
2008-12-16 12:03:05 -08:00
Keith Packard
09039fb89f Patch brown-bag fix for bug 19017 (scrn->virtualX/virtualY 0 before PreInit)
When a driver uses a crtc during device detection, the scrn has not yet been
configured and virtualX/virtualY are still zero. This caused the X server
to try and allocate a shadow frame buffer, which couldn't work.

Detect this by checking for zero virtualX/virtualY values.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 063eb6743c)
2008-12-15 20:12:33 -08:00
Keith Packard
ae2cbbff9f Use scrn->virtualX/virtualY in xf86CrtcFitsScreen. Fix bug 19017.
pScreen->width/height are not initialized when doing initial mode setting,
which makes this function incorrectly fail. Using scrn->virtualX should work
in all cases though.

Bug 19017 reports a crash in xf86CrtcSetModeTransform when doing a modeset
for output probing, long before the screen array is initialized; that was
caused by a work-around to set pScreen->width/height so that xf86CrtcFitsScreen
could find the right values.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fde2f96103)
2008-12-15 11:47:57 -08:00
Keith Packard
8f17a31aa7 Clean up rotation data when crtc is turned off
The shadow frame buffer and other data used for rotation need to be freed
when the crtc is disabled, not just when rotation is disabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1ba4cbb159)
2008-12-15 11:46:47 -08:00
Matthias Hopf
be21199f55 randr: Fix initial panning border copy
Thanks to Julien Cristau for finding this.
2008-12-12 11:01:59 +01:00
Matthias Hopf
ab56607a08 randr: Update initial screen size if panning information is present 2008-12-12 11:01:53 +01:00
Matthias Hopf
657d963a66 randr: Fix error message for bad panning config 2008-12-12 11:01:32 +01:00
Matthias Hopf
44b89dc0a5 randr: Add monitor option "Panning" for initial panning configuration 2008-12-12 11:01:04 +01:00
Matthias Hopf
798a4878a4 randr: Allow panning to be disabled per axis
(cherry picked from commit e5ab9e6662)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:57:13 -08:00
Matthias Hopf
5fa2cce83c randr: Rework panning area verification
(cherry picked from commit bad118ace6)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:57:05 -08:00
Matthias Hopf
97e8a75ce3 randr: Don't change panning parameters if verification fails.
(cherry picked from commit 219c26ce0c)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:56:57 -08:00
Matthias Hopf
6189f0832e randr: Rename pan() to set_origin(), and xf86CrtcPan() to xf86CrtcSetOrigin()
(cherry picked from commit 18a8bac1a1)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:56:47 -08:00
Matthias Hopf
bc05471d11 randr: Panning support
(cherry picked from commit b929d721ef)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:56:17 -08:00
Matthias Hopf
f7e2fee8fe randr: Crtc interface update for panning support.
(cherry picked from commit 834cbc16f3)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:55:57 -08:00
Matthias Hopf
27ca32eb05 randr: Weird enough, crtc->version was never set upon creation. Fix that.
(cherry picked from commit a475eb9fee)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:55:48 -08:00
Maarten Maathuis
991f0be6e2 randr: Avoid needlessly creating a shadow framebuffer.
- pScreen->width and height were zero, so it didn't "fit" the screen.
(cherry picked from commit ffb484f7ef)

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-09 20:41:50 -08:00
Stuart Bennett
0d902b05ad xf86Cursors: xf86_reload_cursors shouldn't unconditionally show hwcursor (#14820)
Also, no need to call ShowCursor when SetCursorPosition already does it
Based on a previous patch by Maarten Maathuis

Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0b8f8b24f7)
2008-12-02 23:08:01 -08:00
Keith Packard
4715f079b9 Merge commit 'origin/master' 2008-11-25 22:19:08 -08:00
Keith Packard
9ffc671939 Move matrix operations from X server to pixman 0.13.2
pixman 0.13.2 now holds all of the matrix operations. This leaves
the protocol conversion routines and some ABI stubs in place

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-11-25 22:17:58 -08:00
Alan Coopersmith
d5f9a131a2 Fix const-mismatch warnings for DisplayModePtr's
Includes fixes for:
"xf86Config.c", line 2434: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 312: warning: argument #1 is incompatible with prototype:
	prototype: pointer to struct _DisplayModeRec: "../../../hw/xfree86/common/xf86.h", line 351
	argument : pointer to const struct _DisplayModeRec

"xf86EdidModes.c", line 438: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec

"xf86Modes.c", line 701: warning: assignment type mismatch:
	pointer to struct _DisplayModeRec "=" pointer to const struct _DisplayModeRec
2008-11-25 15:51:17 -08:00
Keith Packard
c4b9ab6bf5 Handle transform failure when computing shadow damage area.
PictureTransformBounds can fail, when this happens, damage the entire screen
so that the shadow gets repainted correctly.
2008-11-24 13:24:41 -08:00
Keith Packard
7236fd9dd4 Be careful about copying transforms around; they have allocated memory. 2008-11-24 13:24:41 -08:00
Keith Packard
7e69e364d2 Fix rotated/reflected cursor positions.
Doing projective transforms required repositioning the cursor using the
hotspot, but that requires relocating the upper left corner in terms of said
hotspot.
2008-11-24 13:24:40 -08:00
Keith Packard
7c61db66a4 Create rrtransform.[ch]. Add RRTransform argument to RRCrtcNotify.
Instead of using a separate function to notify DIX about transform changes,
add the transform to RRCrtcNotify so that the whole Crtc state changes
atomically.
2008-11-24 13:24:40 -08:00
Keith Packard
6fe9c15731 Allow drivers to set crtc transforms.
Track curent transform down in the mode setting code so that it may be set
separately from RandR.
2008-11-24 13:24:40 -08:00
Keith Packard
49db14e4ac Handle RandR transform matrices in floating point.
RandR matrix computations lose too much precision in fixed point;
computations using the inverted matrix can be as much as 10 pixels off.
Convert them to double precision values and pass those around. These API
changes are fairly heavyweight; the official Render interface remains fixed
point, so the fixed point matrix comes along for the ride everywhere.
2008-11-24 13:24:40 -08:00
Keith Packard
197aa78469 Report whether transforms are support from driver through extension to client
Add APIs to xf86RandR12 support and randr extension to record whether the
driver supports transforms, report that value in the RRGetCrtcTransform
reply.
2008-11-24 13:24:39 -08:00
Keith Packard
e86c34663e Clear shadow pixmaps before using them.
This eliminates some ugly flashing, as well as clearing the borders when the
shadow will not be completely painted.
2008-11-24 13:24:39 -08:00
Keith Packard
8fd82c88e3 Adjust transformed cursor position to account for hotspot 2008-11-24 13:24:38 -08:00
Keith Packard
eb222e6412 Actually use filter kernel size to expand transform redisplay box 2008-11-24 13:24:37 -08:00
Keith Packard
ee6326a6b8 Handle filter widths in xf86Rotate 2008-11-24 13:24:37 -08:00
Keith Packard
ddc8466137 Initialize and cleanup new filter fields in xf86Crtc. 2008-11-24 13:24:37 -08:00
Keith Packard
f50349e193 [RANDR] Support filters in CRTC transforms.
Create new RRTransform datatype to hold all of the transform related
information, use that in lots of places to pass filters around.
2008-11-24 13:24:36 -08:00
Keith Packard
e3d6f279d5 Wire up RandR CRTC transform protocol, bump server to RandR 1.3
This involved removing a pile of matrix code from the DDX,
as well as moving a bit of transform logic from DDX to DIX.
2008-11-24 13:24:36 -08:00
Keith Packard
e063162e80 Add projective transforms to RandR DIX/DDX API.
New RRCrtcGetTransform function in DIX that DDX can use to get the pending
transform. The DDX code should be complete; the DIX code is just a stub at
this point.
2008-11-24 13:24:35 -08:00
Keith Packard
9c7ac47b87 Notify DRI when crtc regions change
Drivers that care about crtc positions on the screen to ensure that vblank
works correctly need to be notified when crtcs are changed.

Provide a hook in the mode setting code that is invoked whenever any
configuration is done to the screen.

Use this new hook in the DRI code so that DRI clients are notified and
receive updated information.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-11-24 13:24:35 -08:00
Alex Deucher
81fd17f5f4 Only add default modes if EDID supports continuous-frequency
When an EDID is present, only add the default mode pool if the
continuous-frequency bit is set in the EDID.  Should fix bugs
like 18512.
2008-11-13 15:00:30 -05:00
Adam Jackson
c232f3d673 xf86TargetExact should try harder if there's only one monitor attached.
If there's no preferred mode, but only one monitor, pick the
biggest mode for its aspect ratio, assuming one exists.
2008-11-13 14:58:21 -05:00
Egbert Eich
9a874a71a7 DDX/RandR: When positioning outputs assume width/height = 0 if no modes exist.
When a user specifies the position of an output for which no modes exist
(for whatever reason) assume that the width and height of this output
is 0. The result will be the same as if this output isn't taken into
consideration at all and thus should be sane. It will prevent a segfault
when trying to determine the width and height of a non-existent mode.
2008-11-04 21:31:27 +01:00
Zhenyu Wang
56c615368c Check nextEnabledOutput()'s return in bestModeForAspect()
In case no enabled outputs, we will reference wrong index of
output array.
2008-10-08 13:33:55 +08:00
Maarten Maathuis
881bd15f44 xf86Crtc: Set mode to NULL, so nothing bad happens if crtc == NULL.
- Fix is courtesy of math_b.
2008-08-31 18:07:22 +02:00
Maarten Maathuis
f4e9a1a98f damage: choose less ambiguous function names 2008-08-31 17:46:26 +02:00
Maarten Maathuis
1861250cd7 {damage,exa}: sanitise damage
- Redo damage naming for more consistency.
- Call post submission functions only where appropriate.
- EXA can now live without it's odd damage workarounds.
2008-08-29 22:15:23 +02:00
Tomas Carnecky
ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00