Commit Graph

57 Commits

Author SHA1 Message Date
Alan Coopersmith 23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Dave Airlie 0b0e714892 exa: pixmap sharing infrastructure (v3)
This just adds exa interfaces for mixed exa so drivers can
share and set shared pixmaps up correctly.

v2: update for passing slave screen.
v3: update for void *

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-07 10:37:10 +01:00
Dave Airlie 1f0e8bd5eb api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.

Its been squashed to make bisection easier.

Full patch log below:

commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon May 14 15:16:11 2012 -0700

    xfree86: Bump video ABI to 13.0

    The ABI was broken by changes to convert from screen index numbers to ScreenPtr
    / ScrnInfoPtr in various structures and function signatures.

    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 10:56:57 2012 +0100

    xf86: xf86ClearEntityListForScreen should take a pScrn

    When adding GPU screens this make life easier.

    (also fix comment, as pointed out by Alan)

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 07:07:32 2012 +0100

    xf86i2c: add pscrn for drivers to use

    This just adds a pScrn pointer into the struct for the drivers to use
    instead of scrnIndex. Mostly scrnIndex is used for logging, but some
    drivers use it to lookup xf86Screens, so let them stash a pScrn instead.

    Removing the scrnIndex is a bit more involved and I'm not sure its worth
    the effort. Doing i2c in the X server is legacy code as far as I'm concerned.

    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 19:25:20 2012 +0100

    dix/gc: consolidate GC object creation in one place

    The standard GC create and scratch GC create were 90% the same really,
    and I have a need in the future for creating GC objects without the
    other bits, so wanted to avoid a third copy.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 10:24:06 2012 +0100

    xf86: add a define to denote the new non-index interfaces are being used

    This can be used by drivers to provide compatible APIs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 15:09:12 2012 +0100

    dix: make Create/Free scratch pixmaps take a ScreenPtr

    While technically an API/ABI change I doubt anyone uses it,
    but it helps in splitting screens up.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:57:55 2012 +0100

    xf86/xv: remove scrnIndexfrom xf86FindXvOptions.

    Move this interface to taking an ScrnInfoPtr.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:53:59 2012 +0100

    xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)

    stop passing indices into this function.

    v2: drop flags argument.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:48:09 2012 +0100

    xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:18:59 2012 +0100

    xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)

    Instead of passing an index, pass the actual ScreenPtr. This allows
    more moving towards not abusing xf86Screens + screenInfo.

    v2: drop the blockData/wakeupData args as per ajax's suggestion.,
    fix docs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date:   Wed Apr 11 09:53:14 2012 +0100

    xf86/common: remove some more pScrn->pScreen uses

    remove some more conversions that appeared after api cleanups.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:34:53 2012 +0100

    ddc: change API to take ScrnInfoPtr (v2)

    This removes all xf86Screens usage from ddc code,
    it modifies the API for some functions to avoid taking indices.

    v2: address Alan's comments about dropping DDC2Init parameter.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:31:26 2012 +0100

    vbe: don't use index for VBEInterpretPanelID (API)

    Remove use of xf86screens from vbe module.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:25:11 2012 +0100

    int10/vbe: don't use xf86Screens. (ABI) (v3)

    Pass the ScrnInfoPtr instead of the index in the int10 struct.

    This saves us using it to dereference xf86Screens.

    v2: address Alan's comment to fix struct alignment.

    v3: squash in all the int10 fixes, test the vm86 code builds,
    after comments by Keith.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:30:18 2012 +0100

    xserver: drop index argument to ScreenInit (ABI/API) (v2)

    This drops the index argument, its the same as pScreen->myNum,
    and its the last major index abuse I can find.

    v2: address Alan's review - update docs, fix xwin/xnest/darwin

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:23:01 2012 +0100

    xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)

    This migrates PointerMoved from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:20:46 2012 +0100

    xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)

    This migrates the PMEvent from index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:18:30 2012 +0100

    xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)

    This migrates the SetDGAMode callback from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:14:11 2012 +0100

    xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)

    This migrates the ChangeGamma interface to avoid passing a index.

    v2: fix xf86RandR12.c + xf86cmap.c call

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:11:09 2012 +0100

    xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)

    The EXA interface migrates to ScreenPtr,
    and the xf86 interface migrated to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:02:11 2012 +0100

    xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)

    This migrates the ValidMode to passing a ScrnInfoPtr instead
    of an index.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:59:46 2012 +0100

    xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)

    This migrate the SwitchMode interface to take a ScrnInfoPtr
    instead of an index.

    v2: drop flags.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:50:37 2012 +0100

    xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)

    This converts AdjustFrame code paths to passing a ScrnInfoPtr
    instead of an integer index.

    v2: drop flags args.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:41:27 2012 +0100

    xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)

    Another index->pScrn conversion.

    v2: drop flags arg.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:35:41 2012 +0100

    xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)

    This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
    instead of an index into xf86Screens. This allows dropping more
    public dereferences of the xf86Screens and screenInfo.

    v2: drop flags args as suggested by Keith, fix docs.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:04:59 2012 +0100

    xserver: remove index from CloseScreen (API/ABI breakage)

    This drops the index from the CloseScreen callback,
    its always been useless really, since the pScreen contains it.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 13:22:18 +01: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
Keith Packard d5b16b037b Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class"
This reverts commit 1564c82417.

The drivers used the top bits of the usage_hint to store driver
private flags (intel, radeon, nouveau).

With EXA we need to get at this data so if we migrate the pixmap we
can create the correct type of pixmap in the driver, however this
commit truncates the usage_hint into 8-bit class and loses all the
good stuff.

Signed-off-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-03-17 23:48:52 -07:00
Adam Jackson 1564c82417 dix: Remove usage_hint from pixmaps, store it in ->drawable.class
The class field was unused for pixmaps, and we don't have enough classes
to justify a whole uint32 anyway.

Reviewed-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:16:50 -05:00
Maarten Maathuis a54c23fe64 exa: s/PixmapIsOffscreen/PixmapHasGpuCopy and s/pExaPixmap->offscreen/pExaPixmap->use_gpu_copy
- Fixup some variable names as well.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-28 12:44:58 -08:00
Dave Airlie 1373c2ea87 exa: clarify createpixmap2 new pitch return 2009-08-15 12:14:26 +10:00
Dave Airlie 1545a120df exa: fix CreatePixmap2 to be useful for tiling.
This adds a pitch return so that the driver can align the pitch to any
value it wishes and not just the one it gave to EXA at startup.
2009-08-14 09:33:48 +10:00
Maarten Maathuis e8ac2ed5dc exa: implement exaMoveInPixmap for "mixed"
- This can be used to force creation of driver pixmap.
- Not for 1 or 4 bpp.
- Driver can still fail (driver) pixmap creation.
2009-08-06 23:48:14 +02:00
Maarten Maathuis 03ecb164f2 exa: A simple 3rd backend implementation.
- Based on driver pixmaps with some changes (completely transparent to driver).
- It helps with the problem of known software fallbacks, such as trapezoids.
- exaDoMigration is now called for all cases that provide a do_migration hook.
- exa_migration.c is renamed to exa_migration_classic.c
2009-08-06 23:48:14 +02:00
Michel Dänzer 268e227ba0 EXA: Make Prepare/FinishAccess tracking resilient to repeated / nested calls.
Use reference counting and do nothing unless the reference count transitions
to/from 0.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=22822 .

As a bonus, this avoids calling the driver Prepare/FinishAccess hooks more than
once per pixmap and operation.

Also update the Doxygen documentation for the PrepareAccess driver hook to
better match current reality.
2009-07-21 14:34:13 +02:00
Michel Dänzer 510cbd43cd EXA: Defragment offscreen memory.
At most once per second, under the following circumstances:

* We can't satisfy an offscreen memory allocation, but there seems to be enough
  offscreen memory available in total.

or

* The server has been idle for at least 100ms, and there is more than one
  available offscreen area.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-18 17:48:57 +02:00
Dave Airlie 8dc8812c22 exa: add missing exa.h header include 2009-04-23 12:13:35 +10:00
Dave Airlie 3ec6a121e1 exa: missed exa.h change 2009-04-23 12:13:05 +10:00
Maarten Maathuis da8ea41a54 exa: increase/rework safety checks in Prepare/FinishAccess. 2009-03-04 16:51:09 +01:00
Maarten Maathuis 7bfad37f77 exa: fixup aux indices and ensure that the indices are used as they should be.
- In a previous patch i forgot to add a FALSE somewhere it seems.
- Rename AUX indices so the driver (think of driver managed pixmaps) can do optimisations based upon them.
- Fix one abuse of DEST index now that we have the AUX indices (same reason as above).
2009-02-27 22:26:52 +01:00
Michel Dänzer 9d5141f7bc EXA: No longer use the driver UploadToScratch hook.
See http://bugs.freedesktop.org/show_bug.cgi?id=20213 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-27 16:37:28 +01:00
Michel Dänzer 4cfb36f6ad EXA: Handle separate alpha maps properly in Composite fallback, take two.
Preserve the EXA ABI by introducing a new driver flag EXA_SUPPORTS_PREPARE_AUX.
If the driver doesn't set this flag, we have to assume any Prepare/FinishAccess
driver hooks can't handle the EXA_PREPARE_AUX* indices, so we move out such
pixmaps at PrepareAccess time.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-27 16:37:28 +01:00
Michel Dänzer de022f8e63 Revert "EXA: Handle separate alpha maps properly in Composite fallback."
This reverts commit 170cf1270d.

Conflicts:

	exa/exa_render.c
2009-02-27 16:37:27 +01:00
Michel Dänzer 170cf1270d EXA: Handle separate alpha maps properly in Composite fallback.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 .

As this can't work without new EXA_PREPARE_AUX* indices, this requires a major
version bump, so we can also drop the UploadToScratch driver hook and
ExaOffscreenSwap*(). So this also fixes
http://bugs.freedesktop.org/show_bug.cgi?id=20213 .

Moreover, introduce EXA_DRIVER_KNOWN_MAJOR to break compilation of drivers
which may not be able to handle EXA_PREPARE_AUX*, giving instructions how to
make them build again in the #error message.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-24 09:22:09 +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 3891dd8924 exa: Add exaDrawableIsOffscreen() to the driver API. 2008-10-21 13:11:16 -04:00
Maarten Maathuis 7c14fdbacf exa: some minor cleanup
- Fix compile warning
- Order exa.h by source file that exports the function.
- Move the function i created earlier to private headers.
2008-08-26 17:56:40 +02:00
Maarten Maathuis 988725f32e exa: move destination damage for internal calls to a special function
- This should improve clarity for someone who isn't familiar with the code.
2008-08-26 17:56:40 +02:00
Michel Dänzer 6c95fae1e9 EXA: Offscreen memory eviction improvements.
* Make sure available areas are considered to have no eviction cost. This seems
  to help for https://bugs.freedesktop.org/show_bug.cgi?id=15513 but I'm afraid
  that may just be coincidence.
* Only calculate eviction cost of each area once for each eviction pass.
  Safeguard against potential (though unlikely) division by zero.
* Cosmetic enhancements: Name eviction cost related variables 'cost' instead of
  'score' to emphasize that smaller values are better, update Doxygen file
  comment to the way eviction works now.
2008-04-21 10:45:11 +02:00
Fredrik Höglund 93d876891d EXA: Improve the algorithm used for tracking offscreen pixmap use.
Replace the current score keeping algorithm with a rolling counter that's
incremented in ExaOffscreenMarkUsed, with the previous value being stored
in the area.  exaOffscreenAlloc uses the difference between the counter
value and the value in the area when deciding which area to evict.
It now also takes the size of the areas into account, and favors evicting
smaller areas.

The credit for these ideas goes to Michel Dänzer.
2008-03-31 21:15:50 +02:00
Bernardo Innocenti e6ea3147bf exa: make the prototype for exaGetPixmapFirstPixel() public
This fixes a warning in amd_drv which is using it.

Signed-off-by: Bernardo Innocenti <bernie@codewiz.org>
2008-01-14 13:09:13 -05:00
Dave Airlie 566dd3b7d7 exa: add new flags to denote driver handles all pixmap migration/hiding 2007-10-03 12:01:37 +10:00
Dave Airlie dc90d50008 exa: increase minor version number for pixmap allocation hooks 2007-10-02 14:05:07 +10:00
Dave Airlie ffb58f4fa8 exa: add hooks for drivers to take over pixmap allocation
This adds hooks for the driver to access Create/DestroyPixmap and ModifyPixmapHe
ader.

It allocates a 0 sized pixmap using fb and calls the driver routine to do
work of allocating the actual memory.

ModifyPixmapHeader is mainly required for hooking the screen pixmap which
isn't create by normal methods
2007-10-02 14:03:39 +10:00
Dave Airlie 31555af000 exa: add a pixmap private pointer for drivers to retrieve. 2007-10-02 13:57:55 +10:00
Tilman Sauerbeck ae8b4f7dcf EXA: Added pitch limitations.
Drivers can now specify the max pitches that the accelerator supports.
2007-09-25 16:43:06 +02:00
Michel Dänzer cc648e609d EXA: Export ExaOffscreenMarkUsed.
Can be used to inform EXA that an offscreen area is used outside of EXA.
2007-05-22 10:51:56 +02:00
Jesse Barnes 1b3a0508a7 Fix documentation for Copy hook -- it can copy memory to the scanout
buffer too.
2007-05-06 01:30:59 -07:00
Thomas Hellstrom f8482967ae Add an EXA driver callback to determine whether a pixmap is
"offscreen" in exa terms, which means accessible to the GPU.
Bump exa minor. The change is backwards-compatible.
2007-04-04 14:04:52 +02:00
Eric Anholt 7a12952fd4 Bug #7639: Only swap out pixmaps (rather than everything) on VT switch in EXA.
This is a new behavior for version 2.1 of EXA, and only takes effect if the
driver has requested that.  Otherwise, the previous behavior remains the same.
2007-01-24 13:34:58 -08:00
Eric Anholt cfbc7379f0 Export exaMove{In,Out}Pixmap(). 2006-12-28 13:15:11 -08:00
Eric Anholt 48c871564d Move EXA_PM_IS_SOLID() to the public API, since drivers will want it frequently. 2006-06-26 15:57:32 +02:00
Eric Anholt a90cff266c Add more doxygen documentation, including notes on WaitMarker() and
MarkSync() that I noticed were needed while reading the VIA driver.
2006-03-15 00:13:52 +00:00
Eric Anholt 9ed3463450 Improve doxygen formatting, and attempt to clarify the 1:1 ratio of
successful PrepareCopy()s to DoneCopy()s.
2006-03-12 03:04:52 +00:00
Eric Anholt 2bd4110549 Document the restriction on PrepareAccess() failure, from discussion with
benh.
2006-03-10 07:45:25 +00:00
Eric Anholt ab35c3fbc1 Do a first pass of doxygen documentation of EXA. This removes the
corresponding pieces of exa-driver.txt, which were becoming stale.
    Hopefully the documentation will stay much more up-to-date this way.
    Many thanks to jbarnes for writing exa-driver.txt which was used a lot
    in writing this documentation.
2006-03-09 23:18:15 +00:00
Eric Anholt 2822cbc1fb Rearrange EXA driver structures so that there's a hope of maintaining ABI
when extending the driver interface. The card and accel structures are
    merged into the ExaDriverRec, which is to be allocated using
    exaDriverAlloc(). The driver structure also grows exa_major and
    exa_minor, which drivers fill in and have checked by EXA
    (double-checking that the driver really did check that the EXA version
    was correct). Removes exaInitCard(), which is replaced by the driver
    filling in the rec by hand, and the exaGetVersion() and related
    EXA_*VERSION which are replaced by always using the XFree86 loadable
    module versioning.
2006-03-09 06:04:07 +00:00
Jesse Barnes 044a3abb38 Add accelerated two directional blt support to EXA 2006-03-01 16:28:34 +00:00
Jesse Barnes e7f0b84fa7 fix exaInitCard by making it a real function 2006-02-28 05:20:20 +00:00
Eric Anholt dc0354104c Move EXA implementation up to the top level and remove its XFree86
dependencies. It was nearly abstract enough already to be used by
    multiple DDXes. This will be useful for EXA development through
    providing a fake acceleration implementation within Xephyr, so that
    testing can be done on new EXA code without worrying about buggy
    drivers.
2006-02-16 00:14:11 +00:00
Benjamin Herrenschmidt 12994b9afb Fix a couple of bugs in the offscreen allocator. One mostly harmless was
causing our search loop for evictable blocks to possibly skip a good
    candiate, and another was the allocator would occasionally use
    area->offset as if it was the base of the pixmap, while for a pixmap
    that is not in available state, it is not. This caused some funny
    miscalculation leading to overlapping pixmaps and accesses beyond the
    end of the framebuffer. To make things cleared, I renamed save_offset
    to base_offset, made sure it's the one used everywhere in the
    allocator, and only align "offset" for the client at the end of
    exaOffscreenAlloc().
2005-10-11 23:11:37 +00:00