Commit graph

4928 commits

Author SHA1 Message Date
Keith Packard
5ab0acfc51 Write a framework to decode edid data in an external program.
This isn't complete, but demonstrates how one would write an external EDID
parser that can work from binary data as dumped by the X server.
2008-03-27 11:44:37 -07:00
Keith Packard
501bdedc11 Merge commit 'origin/master' into transform-proposal 2008-03-27 11:43:29 -07:00
Keith Packard
16ff2196e2 Be careful about copying transforms around; they have allocated memory. 2008-03-21 03:16:09 -07:00
Keith Packard
6acc7e9f65 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-03-21 03:15:00 -07:00
Keith Packard
ea5aeee7b9 rrtransform needs randrstr to get RANDR_INTERFACE defines 2008-03-21 03:14:47 -07:00
Keith Packard
f4d9775253 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-03-21 02:39:49 -07:00
Keith Packard
adae567297 Avoid overflow in PictureTransformPoint. Fix PictureTransformIsIdentity.
PictureTransformPoint computes homogeneous coordinates internally, but fails
to handle intermediate values larger than 16.16. Use 64 bit intermediate
values while computing the final result at 16.16 and only complain if that
result is too large.

PictureTransformIsIdentity was completely wrong -- it was not checking for
identity transforms at all.
2008-03-21 02:35:28 -07:00
Keith Packard
6b59159fdf 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-03-19 12:15:39 -07:00
Keith Packard
5360d47549 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-03-19 00:46:35 -07:00
Keith Packard
71267eb380 Eliminate inverse matrix from randr transform protocol
It is easier, and potentially more precise, to compute the inverse in the
server where everything can eventually be kept in floating point form.
2008-03-18 16:06:06 -07:00
Keith Packard
fd7b5e2c28 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-03-18 16:05:34 -07:00
Keith Packard
85ff452bfc 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-03-18 15:35:12 -07:00
Keith Packard
02b8d204e1 When converting from double to fixed, round carefully.
This reduces the matrix representation error after inverting a
transformation matrix (although it doesn't eliminate it entirely).

Perhaps we should extend Render to include 64-bit floating point transforms...
2008-03-18 15:15:40 -07:00
Eamon Walsh
edad0a9dfe Apply __glXDisp_GetVisualConfigs message patch
From http://bugs.freedesktop.org/show_bug.cgi?id=13863

Problem was that the glxcmds.c __glXDisp_GetVisualConfigs
function left garbage in the tail end of the message used for extensions.
2008-03-18 18:04:14 -04:00
Dodji Seketeli
cdadd2ff9b [Xephyr/DRI] correctly route motion events targeted at GL drawable 2008-03-18 14:02:41 +01:00
Keith Packard
4184a2db90 Compute matrix inversion instead of using wire version in RRCrtcTransformSet
It doesn't make sense to have the client invert this matrix when the server
can do so reasonably efficiently. This avoids weird fixed point rounding
errors when testing the transform against its inverse. Now to fix the
protocol.
2008-03-17 23:04:49 -07:00
Keith Packard
47dcd54077 Add matrix inversion function (uses doubles)
The obvious matrix inversion function, coded using doubles to avoid fiddling
with fixed point precision adventures.
2008-03-17 23:03:56 -07:00
Keith Packard
5ec18f40e7 Adjust transformed cursor position to account for hotspot 2008-03-17 16:14:43 -07:00
Keith Packard
c9204c8fcf Actually use filter kernel size to expand transform redisplay box 2008-03-17 16:14:15 -07:00
Keith Packard
21457a5a6b Correct bilinear filter kernel size (should be 2x2) 2008-03-17 16:13:25 -07:00
Keith Packard
18d6f5b801 Handle filter widths in xf86Rotate 2008-03-17 15:22:06 -07:00
Keith Packard
3b0552541f Initialize and cleanup new filter fields in xf86Crtc. 2008-03-17 15:21:26 -07:00
Keith Packard
1970640dc6 Pass filter kernel size through transforms 2008-03-17 15:20:52 -07:00
Keith Packard
698047944f Add kernel size to Render filters.
This width/height value lets filter users know how far the filter spreads
into the source image.
2008-03-17 15:19:17 -07:00
Jesse Barnes
afd7428690 Cleanup logic in xf86PrepareOutputs
Should have done this in the first place.  Since we're checking for the absence
of the get_crtc callback in the first place, we'll short circuit the later call
and disable the output, so the ugly "continue" block is unnecesary.
2008-03-17 14:55:44 -07:00
Jesse Barnes
ba85caacb5 Make xf86SetDesiredModes aware of current output configuration
By adding a new output callback, ->get_crtc, xf86SetDesiredModes is able to
avoid turning off outputs & CRTCs if the current output<->CRTC mappings are the
same as the desired configuration.  This helps avoid flickering displays at
startup time, which speeds things up a little and looks better.
2008-03-17 14:13:09 -07:00
Keith Packard
2193d49ff1 Use transform when computing scanout size of modes
Report transformed crtc sizes through RandR and Xinerama. Test screen size
against transformed mode sizes when configuring the Crtc.
2008-03-17 13:57:47 -07:00
Jesse Barnes
bee2ddf35f Fail CRTC configuration if !vtSema
Unless we check for vtSema before calling into the CRTC and output callbacks,
we may end up trying to access video memory that no longer exists, leading to a
crash.  So if we don't have vtSema, return FALSE to the caller, indicating that
we didn't do anything.

Fixes #14444.
2008-03-17 08:33:01 -07:00
Matthieu Herrb
db248ffb84 test for the presence of pci_system_init_dev_mem() before calling it.
This avoids creating a dependency on -current libpciaccess for
BSD systems other than OpenBSD (which don't otherwise need it).
2008-03-16 18:46:11 +01:00
Keith Packard
715b158e15 [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-03-15 00:36:45 -07:00
Donnie Berkholz
aa231f28d5 Xephyr: Build fix: Port across XF86dri.c changes from Mesa. 2008-03-14 18:43:41 -07:00
Donnie Berkholz
a955c3b587 Xephyr: Distribute ephyrdriext.h in tarballs. 2008-03-14 18:43:40 -07:00
Keith Packard
207869447a [render] Split out filter finding from filter setting.
To prepare for RandR using filters in transforms, split out
code paths so that the RandR code can validate the filter name and
parameters during the transform set operation so that use of the filter
later will not have unreportable errors.
2008-03-14 13:46:30 -07:00
Daniel Stone
090b26db76 XkbCopyKeymap: Fix broken indentation
An astute observer will note that the entirety of XkbCopyKeymap is indented
with spaces, and no tabs whatsoever, and not commit changes which break the
otherwise consistent indentation.
A non-astute observer will note the breakage when the commit mail comes
through with clearly broken indentation.
A polite, non-astute, observer will then fix it.

C'est la vie.
2008-03-14 21:58:27 +02:00
Daniel Stone
88bec0915e mi: More meaningful assert crashes
When we fail an assert in miregion.c (which happens every now and then,
though I haven't yet checked up why), at least generate a segfault, so
we'll get a backtrace.
2008-03-14 21:56:31 +02:00
Adam Jackson
57d48d94b8 Fix a stray use of ALLOCATE_LOCAL. 2008-03-14 14:46:03 -04:00
Adam Jackson
8248537722 RANDR 1.2: Fix initial mode aspect ratio match in a corner case.
Actually more like in the mainline case, where the ideal mode happens to
be the very first aspect match on the first monitor.  But let's not
split hairs.
2008-03-14 14:24:21 -04:00
Keith Packard
90b55ca9a5 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-03-13 21:31:12 -07:00
Keith Packard
404de98155 Add funcs to convert between protocol and pixman matrices 2008-03-13 21:30:18 -07:00
Keith Packard
3bf59c2fac Randr now depends on Render for matrices 2008-03-13 21:29:19 -07:00
Keith Packard
e65e9b4b12 Export a bunch of matrix operations from render.
The render extension uses many matrix operations internally, this change
exposes those functions to other parts of the server, drivers and
extensions. The change is motivated by the 'transform' additions to the
RandR extension but will likely be useful elsewhere.
2008-03-13 14:50:13 -07:00
Bart Trojanowski
1b9878ffcf Bug #14332: Fix PCI access cycles from x86emu.
The address written to 0xcf8 contains the PCI slot address to send the
config cycle to.  However, we would ignore that and always send the
cycle to the device whose BIOS we were running.  This breaks some
integrated graphics platforms that have explicit knowledge about the
system's host bridge, for example.
2008-03-13 17:42:16 -04:00
Doug Chapman
f7abe05b33 Bug #14091: Fix build (and runtime) on ia64. 2008-03-13 17:40:34 -04:00
Adam Jackson
5d7437c29e RANDR 1.2: Fix the RANDR 1.1 screen size estimation to approach reality.
While the ScreenRec's notion of size in millimeters would get updates,
the RANDR 1.1 notion wouldn't, so your screen would appear to be square
and probably at some ludicrous DPI.
2008-03-13 17:37:12 -04:00
Adam Jackson
61c3f63a75 RANDR 1.2: Don't report a square resolution to RANDR 1.1 clients.
It can't possibly do anything useful, and older versions of Gnome (and
proably others) get very confused by it.  So do the drivers, for that
matter.
2008-03-13 17:34:54 -04:00
Keith Packard
3c01bd180d 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-03-13 14:26:01 -07:00
Mark Kettenis
06c0372c3a OpenBSD support for libpciaccess.
xserver and libpciaccess both need to open /dev/xf86, which can only
be opened once.  I implemented pci_system_init_dev_mem() like Ian
suggested.  This requires some minor changes to the BSD-specific
os-support code.  Since pci_system_init_dev_mem() is a no-op on
FreeBSD this should be no problem.
2008-03-12 21:45:37 +01:00
Matthias Hopf
2036851125 Return randr interface version in xf86CrtcScreenInit()
Necessary to allow drivers to be run-time backwards compatible when using the
modes/ functions w/o providing their own copy.
2008-03-12 11:37:28 +01:00
Kristian Høgsberg
c7536f4b87 Silence REGION_INIT() warning.
Evaluating the address of a BoxRec as a boolean gives this warning:

  i830_driver.c:2317: warning: the address of 'ScreenBox' will always
  evaluate as 'true'

which is pretty annoying.  This patch compares the address to NULL to
avoid the pointer->bool conversion and gets rid of the warning.  Seems
like a lame hack, but the warning is worse.
2008-03-11 13:18:01 -04:00
Kristian Høgsberg
cc05255191 Make WriteToClient take a const void * like any decent IO write function.
Enough with the casting.  Doesn't break API or even ABI, but does make
a lot of silly casts superfluos.
2008-03-11 00:56:17 -04:00