summaryrefslogtreecommitdiff
path: root/randr/rrcrtc.c
AgeCommit message (Collapse)AuthorFilesLines
2010-09-29randr: set error numbers of resource types in RRExtenstionInit() (V2)Tobias Droste1-1/+10
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=30367 Currently the ddx calls xf86RandR12Init() (-> RRScreenInit() -> RRInit() -> RRModeInit() -> RRCrtcInit() -> RROutputInit()) before RRExtensionInit() is called. This causes RRErrorBase being 0 while setting resource type error values (resource types: RROutput, RRMode and RRCrtc). The fix moves the setting of error values to own functions which are called in RRExtensionInit() to get the right RRErrorBase. V2: With header file Signed-off-by: Tobias Droste <tdroste@gmx.de> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10Ignore RandR timestamps harderKeith Packard1-33/+0
Checking timestamps in post 1.1 randr requests was never a good idea, let's ignore them and just make the configuration changes. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Chase Douglas <chase.douglas@canonical.com>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov1-24/+12
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-19Add typed resource-lookup errors for non-core resource types.Jamey Sharp1-1/+2
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19Set event sequence number in WriteEventsToClient instead of at callers.Jamey Sharp1-1/+0
TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-7/+7
Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-26/+26
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith1-3/+1
Convert all calls of CreateNewResourceType to pass name argument Breaks DIX ABI. ABI versions bumped: Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-07-14randr: switch to byte counting functionsPeter Hutterer1-7/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-08Make RANDR 'set' timestamps follow client specified time. Bug 21987.Keith Packard1-1/+4
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-04-29Fix most remaining deprecated resource lookups.Eamon Walsh1-45/+16
Callsites updated to use dixLookupResourceBy{Type,Class}. TODO: Audit access modes to make sure they reflect the usage.
2009-02-17RANDR: Fail softly on GetPanning if the screen can't do it.Adam Jackson1-16/+17
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-01-30Make RandR CRTC info report panning area instead of just crtc areaKeith Packard1-5/+18
This makes the RandR info consistent with the Xinerama info. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-17randr: Improve per-crtc gamma support.Maarten Maathuis1-2/+33
- 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-11randr: Oops, miscalculated panning rectangle's coordinatesMatthias Hopf1-4/+4
2008-12-04randr: Nuke config-timestamp for panningMatthias Hopf1-15/+0
2008-12-04randr: Protocol bits for panning supportMatthias Hopf1-0/+167
2008-12-03randr: add swapped dispatch for RR[GS]etCrtcTransformJulien Cristau1-3/+3
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-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-24/+24
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-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-24/+24
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-25Move matrix operations from X server to pixman 0.13.2Keith Packard1-12/+12
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-24[randr] don't try to compute crtc transform when no mode is set.Keith Packard1-1/+1
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-24Update RandR global transform when driver notifies of transform change.Keith Packard1-0/+9
Need to compute and save the global transform when the driver changes it.
2008-11-24Create rrtransform.[ch]. Add RRTransform argument to RRCrtcNotify.Keith Packard1-222/+8
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-24Allow drivers to set crtc transforms.Keith Packard1-22/+34
Track curent transform down in the mode setting code so that it may be set separately from RandR.
2008-11-24Handle RandR transform matrices in floating point.Keith Packard1-43/+93
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-24Eliminate inverse matrix from randr transform protocolKeith Packard1-2/+0
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-24Report whether transforms are support from driver through extension to clientKeith Packard1-2/+13
Add APIs to xf86RandR12 support and randr extension to record whether the driver supports transforms, report that value in the RRGetCrtcTransform reply.
2008-11-24Compute matrix inversion instead of using wire version in RRCrtcTransformSetKeith Packard1-3/+2
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-11-24Pass filter kernel size through transformsKeith Packard1-10/+18
2008-11-24Use transform when computing scanout size of modesKeith Packard1-32/+40
Report transformed crtc sizes through RandR and Xinerama. Test screen size against transformed mode sizes when configuring the Crtc.
2008-11-24[RANDR] Support filters in CRTC transforms.Keith Packard1-40/+199
Create new RRTransform datatype to hold all of the transform related information, use that in lots of places to pass filters around.
2008-11-24Wire up RandR CRTC transform protocol, bump server to RandR 1.3Keith Packard1-2/+201
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-24Add projective transforms to RandR DIX/DDX API.Keith Packard1-0/+19
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-08-21Add swapped dispatch for randr 1.2 requestsJulien Cristau1-1/+10
2007-11-19Merge branch 'master' into XACE-SELINUXEamon Walsh1-1/+1
Conflicts: hw/xnest/Pixmap.c include/dix.h
2007-11-15Allocate RRCrtcRecs with calloc.Adam Jackson1-1/+1
2007-11-14Merge branch 'master' into XACE-SELINUXEamon Walsh1-1/+2
Conflicts: Xext/xace.c Xext/xace.h
2007-11-12Only clear crtc of output if it is the one we're actually working on.Matthias Hopf1-1/+2
Upon recreation of the RandR internal data structures in RRCrtcNotify() the crtc of an output could be NULLed if the crtc was shared (cloned) between two outputs and one of them got another crtc assigned.
2007-10-15registry: Add some missing #include's.Eamon Walsh1-0/+1
2007-10-11dix: Add a new "registry" mechanism for registering string names of things.Eamon Walsh1-3/+1
Supports protocol requests, events, and errors, and resource names. Modify XRES extension to use it.
2007-07-23Set the crtc before the output change is notifiedGustavo Pichorim Boiko1-0/+2
Set the new randr crtc of the output before the output change notification is delivered to the clients. Remove RROutputSetCrtc as it is not really necessary. All we have to do is set the output's crtc on RRCrtcNotify
2007-07-14Screen size bounds check in ProcRRSetCrtcConfig not masking out reflections.Keith Packard1-1/+1
When checking how to validate the selected mode and position against the current screen size, the test against 90/270 rotation did not mask out reflection, so that when reflection was specified, the 90/270 test would never succeed. This caused incorrect bounds checking and would return an error to the user instead of rotating the screen.
2007-04-16RandR 1.2 spec says CRTC info contains screen-relative geometry.Keith Packard1-2/+4
Was reporting mode size instead of adjusting for rotation. (cherry picked from commit e2e7c47a528447e90cff6cf10d2ce457742ef48d)
2007-03-24Make pending properties force mode set. And, remove AttachScreen calls.Keith Packard1-41/+51
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 57e87e0d006cbf1f5b175fe02eeb981f741d92f0) Conflicts: randr/randrstr.h randr/rrcrtc.c I think master and server-1.3-branch are more in sync now.
2007-03-23Make sure RandR events are delivered from RRCrtcSet.Keith Packard1-43/+50
Some paths were skipping the event delivery stage. (cherry picked from commit 9ca7ba5d6012295a77ed773c656e786440da973d)
2007-03-17Correct ref counting of RRMode structuresKeith Packard1-0/+2
RRModes are referenced by the resource db, RROutput and RRCrtc structures. Ensure that the mode reference count is decremented each time a reference is lost from one of these sources. The missing destroys were in RRCrtcDestroyResource and RROutputDestroyResource, which only happen at server reset time, so modes would be unavailable in subsequent server generations.
2007-03-17Add support for user-defined modelines in RandR.Keith Packard1-3/+8
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 63cc2a51ef87130c632a874672a8c9167f14314e) Conflicts: randr/randrstr.h Updated code to work in master with recent security API changes.
2007-03-05Bugzilla #7145: fix build with gcc 2.95Jens Granseuer1-1/+1
Bugzilla #7145: <http://bugs.freedesktop.org/show_bug.cgi?id=7145> Patch #8987: <http://bugs.freedesktop.org/attachment.cgi?id=8987>
2007-02-28Don't crash setting a NULL mode with a randr classic DDX. Also remember to ↵Aaron Plattner1-0/+9
update the screen size during modesets.