Commit Graph

25 Commits

Author SHA1 Message Date
Alan Coopersmith
1c56ac63c0 Convert top level extensions to new *allocarray functions
v2: remove now useless parentheses

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21 16:57:08 -07:00
Dave Airlie
f9c8248b83 randr: don't directly set changed bits in randr screen
Introduce a wrapper interface so we can fix things up for multi-gpu
situations later.

This just introduces the API for now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:08:43 +10:00
Keith Packard
4ba340cfaa randr: Clean up compiler warnings about unused and shadowing variables
set but not used variables
shadowing a previous local

A hidden problem was that the VERIFY_RR_* macros define local 'rc'
variables, any other local definitions for those would be shadowed and
generate warnings from gcc. I've renamed the other locals 'ret'
instead of 'rc'.

Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-21 18:42:46 -07:00
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Alan Coopersmith
05d8a7f7a7 Convert a bunch of sprintf to snprintf calls
This batch is the straightforward set - others are more complex and
need more analysis to determine right size to pass.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Keith Packard
9e8c20b0d4 Revert "randr: Add per-crtc pixmaps"
This reverts commit 82612045e1.
2011-02-23 11:17:42 -08:00
Keith Packard
82612045e1 randr: Add per-crtc pixmaps
This adds new driver hooks to allocate scanout pixmaps and
changes the mode setting APIs to pass the new scanout pixmaps
along from DIX. DIX is responsible for reference counting the pixmaps
by tracking them through RRCrtcNotify.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2010-12-06 20:08:48 -08:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
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>
2010-05-13 00:22:37 +07:00
Keith Packard
28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
This patch was created with:

git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19 09:26:10 -07: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
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
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
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
b2dcfbca24 RRScanOldConfig cannot use RRFirstOutput before output is configured.
RRFirstOutput returns the first active output, which won't be set until
after RRScanOldConfig is finished running. Instead, just use the first
output (which is the only output present with an old driver, after all).
2007-08-08 12:16:32 -07:00
Keith Packard
b4193a2eee RRScanOldConfig wasn't getting crtcs set correctly
The output crtc is set by RRCrtcNotify, which is called at the end of
RRScanOldConfig. Several uses of output->crtc in this function were wrong.
2007-08-07 12:47:18 -07:00
Gustavo Pichorim Boiko
8d23031904 Fix the output->crtc initialization in the old randr setup 2007-07-25 18:12:47 +02:00
Gustavo Pichorim Boiko
5b424b562e Set the crtc before the output change is notified
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-23 14:47:45 -07:00
Keith Packard
804080a709 Make pending properties force mode set. And, remove AttachScreen calls.
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.
2007-03-24 00:01:47 -07:00
Keith Packard
2c93083edd Add support for user-defined modelines in RandR.
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.
2007-03-17 23:20:07 -07:00
Keith Packard
e79602fca2 Use RRScreenSetSizeRange in 1.0 compat. Check RRGetInfo for error.
The RRScreenSizeSetRange function is used externally for 1.2 API drivers,
but can also be used in the 1.0 compatibility code. This also ensures that
the right changed bits are set so that clients are correctly notified when
the range changes.

RRGetInfo can return an error, use that to return BadAlloc to clients
instead of blindly going on with various requests.
(cherry picked from f05dd384d3 commit)
2007-01-02 09:13:39 +11:00
Keith Packard
628c7daeb1 RandR: config time updates when hardware config changes.
The config time in the RandR protocol reflects when the hardware state has
changed. It was getting changed anytime the driver changed the usage
of the hardware as well.
(cherry picked from 98d18a6578 commit)
2006-12-15 18:32:18 +11:00
Keith Packard
ec77a95a02 Allow RandR objects to be created before the associated ScreenRec.
xf86 drivers need to create RandR object in the PreInit stage,
before the ScreenRec is allocated. Changing the RandR DIX code
to permit this required the addition of functions that later associate the
objects with the related screen.

An additional change is that modes are now global, and no longer associated
with a specific screen. This change actually makes mode management cleaner
as there is no more per-screen list of modes to deal with.

This changes the RandR 1.2 ABI/API for drivers.
2006-11-08 21:36:35 -08:00
Keith Packard
4056e6e79a Move physical size from mode to output.
Modes can be shared across different sized monitors this way.

Also caught some missing byteswapping and an incorrect return type.
2006-11-01 00:29:46 -08:00
Keith Packard
c4f30c6353 Add mode origins and output options. Fix memmoves in resource free funcs.
Output options and mode origins both affected driver ABI.  memmove mistakes
were causing 'Freeing resource which isn't there' messages.

Prune unused non-user defined modes from available list now.
2006-10-03 21:06:11 -07:00
Keith Packard
219546fd76 Steal Xinerama code from SiS driver. Add missing files.
Provide a Xinerama implementation when DIX version isn't enabled. This
version exposes each crtc as a separate 'screen' and reports the size of
that patch. The extension also sends ConfigureNotify events to the root
window whenever crtcs change so that applications will re-fetch xinerama
information. This actually works for metacity.
2006-09-20 22:43:05 -07:00