Commit Graph

207 Commits

Author SHA1 Message Date
Eamon Walsh
4098ad72d0 xace: fix access mode in dixLookupWindow within several RandR calls.
Referencing a screen using a window only requires GetAttr access.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-08-17 14:51:11 -04:00
Peter Hutterer
86b239ff9c randr: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14 10:14:01 +10:00
Adam Jackson
b2d2af76b4 randr: fix typo in swapped dispatch 2009-06-15 10:10:26 -04:00
Benjamin Defnet
b2bf67b61c randr: fix operation order so that rotation+transform works
The matrix multiply to combine rotation and projective transforms was being
done in the wrong order.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-11 23:27:36 -07:00
Federico Mena Quintero
e244a5991e dix/randr: Add missing fields to SRR*NotifyEvent()
Also, remove redundant field swaps and make others match the order in which
they are declared in the xRR*NotifyEvent structs.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-09 13:30:45 -07:00
Keith Packard
69a9545d1f Make RANDR 'set' timestamps follow client specified time. Bug 21987.
The lastSetTime value which indicates when the configuration within the
server was last changed was not getting set in the appropriate RandR
requests.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-08 16:54:28 -07:00
Julien Cristau
12e725d08b randr: fix server crash in RRGetScreenInfo
We don't return rates to randr < 1.1 clients, so don't allocate space
for them.  This fixes a FatalError due to not all allocated space being
used.

X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861>

Reported-by: Guillaume Quintin <coincoin169g@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-05-24 11:13:47 +02:00
Eamon Walsh
57aff88c7d Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
2009-04-29 01:04:37 -04:00
Eamon Walsh
6544490700 Correct access mode in call to dixLookupWindow() within RRSelectInput.
Reported by Alan Coopersmith.
2009-03-09 17:29:24 -04:00
Keith Packard
812e8d681a Oops. 62fc98c had crtc offsets applied backwards (fix from server-1.6-branch)
Crtc offsets are in screen space, not crtc space, and hence should be
applied relative to the screen->crtc transform, not the crtc->transform.

This fix was found in the 'cherry pick' of 62fc98c on server-1.6-branch,
clearly some new definition of 'cherry pick' that I am unaware of.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-25 11:08:01 -08:00
Keith Packard
77c7a64e88 RandR rotations and reflections offset by one pixel
The matrix computation for rotation and reflection resulted in dropping a
row or column of pixels as the offsets used in the matrix computations used
width and height rather than width-1 and height-1.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-25 10:12:23 -08:00
Adam Jackson
1230939965 RANDR: Fail softly on GetPanning if the screen can't do it.
Just return a zeroed-out reply in that case.  This is unambiguous, and
distinguishes "you didn't name a CRTC" from "you named a CRTC that can't
do panning".
2009-02-17 13:57:02 -05:00
Peter Åstrand
ddb8d8945d xserver: Avoid sending uninitialized padding data over the network
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16 13:28:38 +10:00
Aaron Plattner
c18f454e4a Query the DDX in ProcRRGetScreenInfo.
This is the RandR 1.1 version of GetScreenResources and needs to re-query the
DDX to see if the mode pool changed.

Fixes Launchpad bug #325115.
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 660c2a7d4c)
2009-02-13 12:41:14 -08:00
Keith Packard
62fc98cb88 Handle matrix computation overflow in RRTransformCompute
If the computation of the composite fixed-point transform for RandR
overflows at any point, take the resulting floating point transform and
scale that back to fit in a fixed point matrix. This ensures that a matrix
will always be available, although perhaps at reduced precision. Someday we
should add floating point matrices to Render.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-03 20:20:57 -08:00
Keith Packard
4de5705545 RandR crtcs not fetched correctly when primary output is set.
Primary outputs may not have a CRTC.
Loops fetching CRTCs respecting primary output were broken.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30 20:21:28 -08:00
Eric Anholt
317f2b4a9f randr: Avoid re-querying the configuration on everything but GetScreenResources.
The new path should only re-query on the other requests when we haven't
gathered the information from the DDX yet (such as with a non-RandR 1.2 DDX).

Bug #19037.
2009-01-30 19:35:55 -08:00
Keith Packard
c1f2be1f3f RandR SetOutputPrimary should work with or without a crtc connected
The test was inverted from the protocol spec, and besides, the test is bogus
anyways.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30 19:15:53 -08:00
Keith Packard
6e49fdd2c8 Make RandR CRTC info report panning area instead of just crtc area
This makes the RandR info consistent with the Xinerama info.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30 15:43:04 -08:00
Julien Cristau
47438a2161 randr: RRSetPrimaryOutput can be static 2009-01-11 08:54:12 +01:00
Paulo Cesar Pereira de Andrade
200230535f Update sdk headers to export new symbols.
All symbols in installed sdk headers should be explicitly tagged
as exported symbols. Otherwise, to ensure it is not a mistake, one
could write it as something like:
extern /* NOEXPORT */ type name ...;
but the proper procedure really should be to use a non sdk header
(or a "noinst_" one).
  This patch also removes prototypes to some functions that existed
only temporarily.
2009-01-05 16:49:57 -02:00
Daniel Stone
e351d10773 RandR: Only export Xinerama symbols when building Xinerama support
Otherwise compilation fails due to sdksyms.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-05 17:41:38 +02:00
Maarten Maathuis
332d65ec7a randr: Consider panned crtc's when calculating xinerama screen sizes.
- This will allow window managers and applications to actually use the panned area.
2008-12-19 18:59:27 +01:00
Maarten Maathuis
91f73b79b7 randr: Improve per-crtc gamma support.
- The Gamma values from the monitor section are now used during initial config.
- The old colormap system is disabled when gamma set hook is available.
- Gamma values are now persistent for the lifetime of the xserver.
- This requires no driver changes and should be driver ABI compatible.
2008-12-17 17:03:12 +01:00
Peter Hutterer
cb95642dc8 Remove #define NEED_EVENTS and NEED_REPLIES
A grep on xorg/* revealed there's no consumer of this define.

Quote Alan Coopersmith:
"The consumer was in past versions of the headers now located
in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h,
all the event definitions were only available if NEED_EVENTS were
defined, and all the reply definitions required NEED_REPLIES.

Looks like Xproto.h dropped them by X11R6.3, which didn't have
the #ifdef's anymore, so these are truly ancient now."

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-12 11:43:32 +10:00
Matthias Hopf
fd77ce9f88 randr: Oops, miscalculated panning rectangle's coordinates 2008-12-11 18:30:25 +01:00
Adam Jackson
86c64ddf21 randr: clear primaryOutput when the output is deleted 2008-12-10 11:31:28 -05:00
Adam Jackson
fe65f400ed randr: use primary output for RRFirstOutput() 2008-12-10 11:31:28 -05:00
Adam Jackson
cdcb516e56 randr: Mangle GetScreenResources sort order based on primary output 2008-12-10 11:31:28 -05:00
Adam Jackson
d7b316e82b randr: Mangle compat Xinerama reply based on primary output 2008-12-10 11:31:27 -05:00
Adam Jackson
9d58d2a319 randr: Add [GS]etOutputPrimary 2008-12-10 11:31:21 -05:00
Matthias Hopf
44bef8b850 randr: Update SProcRandrVector for panning 2008-12-05 15:37:15 +01:00
Matthias Hopf
825b2c2f4a randr: Nuke config-timestamp for panning 2008-12-04 18:16:43 +01:00
Matthias Hopf
eeeb98d1df randr: Protocol bits for panning support 2008-12-04 18:16:43 +01:00
Julien Cristau
0b5ecabfb8 randr: add swapped dispatch for RR[GS]etCrtcTransform
Fix a memory leak in ProcRRGetCrtcTransform() while I'm at it.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Cc: Keith Packard <keithp@keithp.com>
2008-12-03 17:33:47 +01:00
Paulo Cesar Pereira de Andrade
49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Adam Jackson
b0d371ab0a randr: Don't send output property events on server exit
If the Window resource type is already gone, there's no point in trying
to send events, all it can do is access already-freed memory.

Relevant thread:

http://lists.freedesktop.org/archives/xorg/2008-November/040443.html
2008-12-01 11:36:06 -05:00
Paulo Cesar Pereira de Andrade
fb22d4d928 Remove declarations of symbols that are never defined.
These symbols were removed from the X Server, or never declared.
  One symbol that may need special attention is XkbBuildCoreState(),
that doesn't have a prototype anywhere, but is called from
xkb/xkbEvents.c:XkbFilterEvents(), and also used by the macros
XkbStateFieldFromRec() and XkbGrabStateFromRec() defined in
include/xkbstr.h.
  fb/wfbrename.h also may need some cleanup, as it makes several
"renames" of non existing symbols.
2008-11-30 01:33:20 -02:00
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Keith Packard
fc70839431 Add server support for RRGetScreenResourcesCurrent
This depends on randrproto 1.2.99.1

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-11-26 15:50:54 -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
Keith Packard
9c7679240a [randr] don't try to compute crtc transform when no mode is set.
Dereferencing the NULL mode pointer would cause a crash. As these transform
matrices won't be used while the CRTC is disabled, just leave their values
alone.
2008-11-24 13:24:41 -08:00
Keith Packard
315b6d0a42 Update RandR global transform when driver notifies of transform change.
Need to compute and save the global transform when the driver changes it.
2008-11-24 13:24:41 -08:00
Keith Packard
5d9282fde9 Export rrtransform.h as needed by randrstr.h
When the transform management was moved from randrstr.h, the associated
header file became necessary to build drivers. Include it as a part of the
sdk headers.
2008-11-24 13:24:41 -08:00
Keith Packard
93179c214f rrtransform needs randrstr to get RANDR_INTERFACE defines 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
6f734aecae 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-11-24 13:24:39 -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