Commit Graph

269 Commits

Author SHA1 Message Date
Matthias Hopf
cadf65a6e1 randr: Nuke broken set_origin shortcut
Shortcut is impossible to implement this way, because we don't know for sure
whether the crtc of an output has changed or not.
2009-03-10 15:49:49 +01:00
Adam Jackson
8a6ed44a8b randr: Fix thinko in xf86TargetPreferred
The only-one-output case would only work right if that also happened to
be the zeroth output.  Oops.
2009-03-02 14:26:23 -05:00
Keith Packard
c090f5514d Pre-clip panning coordinates to keep crtc within panning region
There is a separate panning region check, but that doesn't work under
transformation, so just pre-clip the mouse coordinates when computing the
panning offsets. This leaves the case where panning constants are changing
unresolved.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-25 10:14:36 -08:00
Keith Packard
5394b7e662 Eliminate the shadow clear on transform change
When the crtc transformation changes, the entire crtc must be repainted.
This was being done by clearing the shadow and then painting the rectangle
containing the screen image; the clear being required as the screen image
may not fill the crtc. When changing the transform rapidly, this leads to
flashing. Eliminate the clear by painting the entire crtc instead of just
the screen rectangle.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-02-17 11:09:08 -08:00
Julien Cristau
ab331aa76f xfree86: ModeDebug is a boolean, not a string
Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-02-16 23:08:09 +01:00
Chris Ball
45e14f5153 Build fix for xf86EdidModes.c
Commit 20ac314.. forgets to declare hsize/vsize/refresh.
2009-02-13 20:32:02 -05:00
Adam Jackson
20ac3140ce EDID: Hack for 1366x768 in standard timing descriptors
All you get for standard timing descriptors is horizontal size in
multiples of 8 pixels (which means you can't say 1366) and height in
terms of aspect ratio (which means you can't say 768).  You'd like to
just fuzzy-match this by walking the DMT list for sufficiently close
modes, but you can't because DMT is useless and only defines a 1360x768
mode, because it's _also_ specified in terms of character cells despite
providing pixel exact timings.  Neither can you use CVT or GTF to
generate the timings, because they _also_ believe that modes have to be
a multiple of 8 pixels.

You'd also hope you could find a timing definition for this in CEA, but
you can't because CEA only defines transmission formats that actually
exist.  So there's 480p, 720p, and 1080p, but no 768p.  And why would
there be, after all, the encoded signal is never 768p so obviously no
one would ever make a display in that format.

So instead, make a CVT mode since that's likely to be handled well by
just about everything, smash the horizontal active down by 2, and shift
the sync pulse by 1.  Underscanning the hard way.

Pass the suicide.
2009-02-13 15:12:06 -05:00
Adam Jackson
bcafdfbed6 RANDR: Validate entire mode list for interlace and doublescan
Otherwise drivers have to refuse interlace twice: once in the output
config, and once in ->valid_mode() to catch output and config modes.
If you can't do interlaced modes, asking nicely for it in the config
isn't going to suddenly make it work.
2009-02-13 14:06:07 -05:00
Keith Packard
7968823cbc 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>
2009-02-03 20:21:07 -08:00
Keith Packard
763df9eec7 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>
2009-02-03 20:21:02 -08:00
Tomas Carnecky
bc57efffe6 Fix "warning: unused variable XXX"
events.c:4614: warning: unused variable ‘kbd’
xkbUtils.c:361: warning: unused variable ‘maxKeysPerMod’
xf86Events.c:409: warning: unused variable ‘ke’
generic.c:131: warning: unused variable ‘cs’
generic.c:130: warning: unused variable ‘size’
xf86RandR12.c:591: warning: unused variable ‘crtc’

Signed-off-by: Tomas Carnecky <tom@dbservice.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04 09:41:25 +10:00
Pierre Willenbrock
29b3b88dc7 Prevent double unref of glxdrawables
Found by valgrind. Bug #18917.
2009-02-01 09:06:43 -08:00
Eric Anholt
f716e3f344 modes: Protect xf86_crtc_supports_gamma() from non-RandR 1.2 drivers. 2009-01-30 20:10:21 -08:00
Keith Packard
ea309e4745 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.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30 14:19:41 -08:00
Keith Packard
fff00df94d Ignore EDID-supplied monitor physical sizes for core screen size
We report the EDID values in RandR, and we let people configure whatever
they like for the screen in xorg.conf. Reporting the EDID values in the core
means applications get inconsistent font sizes in the default configuration.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-30 14:16:12 -08:00
Xiang, Haihao
5f3188228e 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.
2009-01-09 09:37:56 -08: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
7da4e901e0 XFree86: Fix build with DGA disabled
It's optional, so we might as well work when it's disabled.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-05 11:23:39 +02:00
Maarten Maathuis
b5736d237a randr/xfree86: Fix initial gamma computation.
- The previous version overflowed sometimes.
2008-12-22 19:54:17 +01:00
Maarten Maathuis
82fba7697f xfree86/randr: Avoid a crash when xf86CrtcConfigPrivateIndex is -1. 2008-12-22 00:33:55 +01:00
Maarten Maathuis
aedd2f566d 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.
2008-12-19 19:10:23 +01:00
Maarten Maathuis
3d3c234b43 randr: add some notes about the stuff that changed in driver ABI 2 2008-12-18 16:26:38 +01:00
Maarten Maathuis
1b244feb4c randr: check for malloc failure 2008-12-18 16:12:12 +01:00
Maarten Maathuis
1001403301 Forgot to fix a comment. 2008-12-18 00:19:06 +01:00
Maarten Maathuis
9fa15bef59 randr: some improvements, fixes and crtc abi bump
- Add active field to crtc.
- Set gamma (only) whenever a crtc becomes active.
- Check for xf86_config being NULL.
- Increase crtc abi to 3.
- A few other fixes.
2008-12-17 23:46:31 +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
Matthias Hopf
8511a964f8 randr: Update EDID_ATOM_NAME to reflect RandR 1.3 name change 2008-12-16 18:21:20 +01:00
Keith Packard
063eb6743c 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>
2008-12-15 19:58:20 -08:00
Keith Packard
fde2f96103 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>
2008-12-15 11:45:43 -08:00
Keith Packard
1ba4cbb159 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>
2008-12-15 11:45:42 -08:00
Cooper Yuan
2a61397d17 Fix typo in xf86PickCrtcs() 2008-12-15 10:29:34 -05:00
Matthias Hopf
d41b8960be randr: Fix initial panning border copy
Thanks to Julien Cristau for finding this.
2008-12-11 18:48:02 +01:00
Matthias Hopf
f8e52f1b6d randr: Update initial screen size if panning information is present 2008-12-11 18:30:25 +01:00
Matthias Hopf
24d6b7d1c5 randr: Fix error message for bad panning config 2008-12-11 18:30:25 +01:00
Matthias Hopf
fdbbe65a7e randr: Add monitor option "Panning" for initial panning configuration 2008-12-11 18:30:25 +01:00
Paulo Cesar Pereira de Andrade
b1dac41fb3 Use libtool convenience libraries and better "symbol" table.
All .a libraries were converted to .la, and instead of linking the
Xorg binary with a mix of .a and .la, and adding some libraries more
then once in the command line, etc, now it generates a single libxorg.la
from all the required convenience libraries, and links with a dummy
xorg.c (that should usually be the file with the main function...).
This removes the requirement of some things like libosandcommon and
libinit, that existed to circumvent problems when linking multiple
.a and .la in the final Xorg binary.

  The "symbol table" is now generated dynamically, by a shell script,
with an embedded gawk parser that parses cpp output. The new file
sdksyms.sh is generated by hand by analyzing all Makefile.am's and
making it create a sdksyms.c file, that includes all sdk headers that
will add symbols for the Xorg binary. Module headers aren't read, and
a in 2 files it was required to add a "<hash>ifndef XorgLoader" around
declarations shared between the Xorg binary and libextmod. A few
other changes were added to other sdk headers, like preventing
multiple inclusion, or including other headers to satisfy dependencies.

  This should be a lot more portable, and better (hopefully properly)
using libtool to generate convenience libraries.
2008-12-07 02:22:19 -02:00
Paulo Cesar Pereira de Andrade
091a50d126 Move _X_EXPORT attribute to header file.
The attribute should be set on header files to make it easier to
manage what symbols are available to modules.
  _X_EXPORT should be used in sources only for special cases, like
symbols that must be visible by non video/input driver/modules but
should not be "advertised" in the sdk.
2008-12-04 18:23:25 -02:00
Matthias Hopf
e5ab9e6662 randr: Allow panning to be disabled per axis 2008-12-04 18:16:43 +01:00
Matthias Hopf
bad118ace6 randr: Rework panning area verification 2008-12-04 18:16:43 +01:00
Matthias Hopf
219c26ce0c randr: Don't change panning parameters if verification fails. 2008-12-04 18:16:43 +01:00
Matthias Hopf
18a8bac1a1 randr: Rename pan() to set_origin(), and xf86CrtcPan() to xf86CrtcSetOrigin() 2008-12-04 18:16:43 +01:00
Matthias Hopf
b929d721ef randr: Panning support 2008-12-04 18:16:43 +01:00
Matthias Hopf
834cbc16f3 randr: Crtc interface update for panning support. 2008-12-04 18:16:42 +01:00
Matthias Hopf
a475eb9fee randr: Weird enough, crtc->version was never set upon creation. Fix that. 2008-12-04 18:16:42 +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
Stuart Bennett
0b8f8b24f7 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>
2008-12-02 22:54:18 -08:00
Kristian Høgsberg
09df7cc5ad Avoid dereferencing NULL pScreen in xf86CrtcSetModeTransform().
We can get there during PreInit as we set a mode for load detection.
At that time there's no pScreen anywhere, so just skip the optimization
then.
2008-12-01 12:41:10 -05: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
Maarten Maathuis
ffb484f7ef randr: Avoid needlessly creating a shadow framebuffer.
- pScreen->width and height were zero, so it didn't "fit" the screen.
2008-11-29 14:30:55 +01:00
Paulo Cesar Pereira de Andrade
31285d063e Make visible symbols required by xorg modules.
This patch exports all symbols required by the compilable
(in a x86 linux computer) xorg/driver/* modules.
  Still missing symbols worth mentioning are:

sunleo
	miFindMaxBand no longer available

intel	(uxa/uxa-accel.c)
	fbShmPutImage no longer available (and should have been static)

mga
	MGAGetClientPointer (should come from matrox's libhal)

  This is not a definitive "visibility" patch, as all it does is to
export missing symbols, but the modules that current don't compile,
may require more symbols once fixed, and third party drivers should
also require more symbols exported.
  A "definitive" patch should export symbols defined in the sdk.
2008-11-28 01:55:11 -02:00