Commit Graph

387 Commits

Author SHA1 Message Date
Peter Hutterer 7b79a2e4a1 fb: drop two unneeded shadowing variables
fbpict.c: In function 'fbGlyphs':
fbpict.c:188:6: warning: declaration of 'x' shadows a previous local
[-Wshadow]
fbpict.c:111:9: warning: shadowed declaration is here [-Wshadow]
fbpict.c:188:9: warning: declaration of 'y' shadows a previous local
[-Wshadow]
fbpict.c:111:12: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2013-02-15 11:58:24 +10:00
Yaakov Selkowitz ea1d76d1b6 Fix formatting of address operators
The formatter confused address operators preceded by casts with
bitwise-and expressions, placing spaces on either side of both.
That syntax isn't used by ordinary address operators, however,
so fix them for consistency.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05 18:09:48 -06:00
Yaakov Selkowitz 1fe30c0067 fb: fix shadow warnings
fbblt.c: In function 'fbBlt':
fbblt.c:76:16: warning: declaration of 'src' shadows a previous local
fbblt.c:52:13: warning: shadowed declaration is here
fbblt.c:77:16: warning: declaration of 'dst' shadows a previous local
fbblt.c:52:19: warning: shadowed declaration is here
fbbltone.c: In function 'fbBltPlane':
fbbltone.c:742:13: warning: declaration of 'w' shadows a previous local
fbbltone.c:725:9: warning: shadowed declaration is here

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-11-05 13:25:01 -06:00
Søren Sandmann Pedersen 9cbcb5bd6a Use new pixman_glyph_cache_t API that will be in pixman 0.28.0
This new API allows glyphs to be cached in a data structure in pixman,
and entire glyph strings to be composited in one go.

Also bump pixman dependency to 0.27.2.

Results from the cairo peformance test suite running against Xvfb with
a screen size of 1680x1050@32bpp:

Speedups
========
 xlib          firefox-talos-gfx  12416.63 -> 3603.93   3.45x speedup
██▌
 xlib          xfce4-terminal-a1   1727.57 -> 1048.85:  1.65x speedup
▋
 xlib                  evolution   1370.49 -> 869.34:   1.58x speedup
▋
 xlib         gnome-terminal-vim   1832.83 -> 1251.94:  1.46x speedup
▌
 xlib                    poppler   1519.70 -> 1204.05:  1.26x speedup
▎
 xlib       firefox-planet-gnome   6982.55 -> 5598.16:  1.25x speedup
▎
 xlib                  ocitysmap   1142.77 -> 1071.53:  1.07x speedup
▏

No slowdowns were reported.

Results of x11perf -aa10text:

Before:

      8000000 reps @   0.0007 msec (1450000.0/sec)
      8000000 reps @   0.0007 msec (1460000.0/sec)
      8000000 reps @   0.0007 msec (1460000.0/sec)
      8000000 reps @   0.0007 msec (1470000.0/sec)
      8000000 reps @   0.0007 msec (1480000.0/sec)
     40000000 trep @   0.0007 msec (1460000.0/sec)

After:

     32000000 reps @   0.0002 msec (4910000.0/sec)
     32000000 reps @   0.0002 msec (4830000.0/sec)
     32000000 reps @   0.0002 msec (4890000.0/sec)
     32000000 reps @   0.0002 msec (4830000.0/sec)
     32000000 reps @   0.0002 msec (4900000.0/sec)
    160000000 trep @   0.0002 msec (4870000.0/sec)

Version 2: Destroy the glyph cache at server regen time

Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
2012-10-25 11:37:50 -04:00
Daniel Martin 76d8739b1f dix: Remove #includes of mibstore.h
Remove more backing store leftovers.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:31:27 -07:00
Simon Schubert 863d528a9f fb: reorder Bresenham error correction to avoid overshoot.
When fbBresSolid draws a line, it can happen that after the last
pixel, the Bresenham error term overflows, and fbBresSolid paints
another pixel before adjusting the error term.

However, if this happens on the last pixel (len=0), this extra pixel
might overshoot the boundary, and, in rare cases, lead to a segfault.

Fix this issue by adjusting for the Bresenham error term before
drawing the main pixel, not after.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24274
Signed-off-by: Simon Schubert <2@0x2c.or>
Tested-by: Mitch Davis <mjd+freedesktop.org@afork.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-14 12:14:25 -07:00
Keith Packard 7ca32f1c28 Use new screen-specific privates for fb window and gc privates
This ensures that only screens using fb will have this space allocated.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-07-05 13:40:18 -07: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
Kirill Elagin 5361121339 Fix server crash due to invalid images
See https://bugs.freedesktop.org/show_bug.cgi?id=39383

Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 20:18:17 -07:00
Aaron Plattner 03d032991d fb: Rename wfbTriangles and wfbTrapezoids
These symbols were not renamed when they were added to libfb:

 # nm -D libwfb.so | grep ' fb'
 0000000000028d00 T fbTrapezoids
 0000000000028d60 T fbTriangles

This causes corruption and/or crashes on wfb-ful drivers like nvidia:

 Program received signal SIGABRT, Aborted.
 0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
     in ../nptl/sysdeps/unix/sysv/linux/raise.c
 (gdb) bt
 #0  0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 #1  0x00007fd67f3a3680 in *__GI_abort () at abort.c:92
 #2  0x00007fd67f3995b1 in *__GI___assert_fail (assertion=0x7fd679ecb804 "key->initialized", file=<optimized out>, line=116, function=0x7fd679ecbbc0 "dixGetPrivateAddr")
     at assert.c:81
 #3  0x00007fd679ec55b6 in ?? () from /usr/lib/xorg/modules/libfb.so
 #4  0x00007fd679eca9ef in ?? () from /usr/lib/xorg/modules/libfb.so
 #5  0x00007fd679ecae20 in fbTriangles () from /usr/lib/xorg/modules/libfb.so
 #6  0x00007fd67a58fc55 in ?? () from /usr/lib/xorg/modules/drivers/nvidia_drv.so
 #7  0x00000000004f38d1 in ?? ()
 #8  0x0000000000437ae9 in ?? ()
 #9  0x0000000000426eaa in ?? ()
 #10 0x00007fd67f38cead in __libc_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, fini=<optimized out>,
     rtld_fini=<optimized out>, stack_end=0x7fff99860d78) at libc-start.c:228
 #11 0x000000000042719d in _start ()

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 14:14:05 -07:00
Adam Jackson e32cc0b4c8 fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right.  That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption.  Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)

On an Intel Core i7-2630QM with an NVIDIA GeForce GTX 460M running in
NoAccel, the broken code and various fixes for -copywinwin{10,100,500}
gives (edited to fit in 80 columns):

1: Disable the fastpath entirely
2: Replace memcpy with memmove
3: This fix
4: The code before this fix

  1            2                 3                 4           Operation
------   ---------------   ---------------   ---------------   ------------
258000   269000 (  1.04)   544000 (  2.11)   552000 (  2.14)   Copy 10x10
 21300    23000 (  1.08)    43700 (  2.05)    47100 (  2.21)   Copy 100x100
   960      962 (  1.00)     1990 (  2.09)     1990 (  2.07)   Copy 500x500

So it's a modest performance hit, but correctness demands it, and it's
probably worth keeping the 2x speedup from having the fast path in the
first place.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-15 15:38:16 -07:00
Cyril Brulebois fe6f489d21 fb: Mark some variables as unused.
There's no use for the values set through the various macro calls
(fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused.

The following warnings go away accordingly:
|   CC     libfb_la-fb24_32.lo
| fb24_32.c: In function 'fb24_32ReformatTile':
| fb24_32.c:544:19: warning: variable 'newYoff' set but not used [-Wunused-but-set-variable]
| fb24_32.c:544:10: warning: variable 'newXoff' set but not used [-Wunused-but-set-variable]
| fb24_32.c:543:19: warning: variable 'oldYoff' set but not used [-Wunused-but-set-variable]
| fb24_32.c:543:10: warning: variable 'oldXoff' set but not used [-Wunused-but-set-variable]
|   CC     libfb_la-fbfill.lo
| fbfill.c: In function 'fbFill':
| fbfill.c:72:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
| fbfill.c:72:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
| fbfill.c💯21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
| fbfill.c💯11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
| fbfill.c:142:20: warning: variable 'tileYoff' set but not used [-Wunused-but-set-variable]
| fbfill.c:142:10: warning: variable 'tileXoff' set but not used [-Wunused-but-set-variable]
|   CC     libfb_la-fbgc.lo
| fbgc.c: In function 'fbPadPixmap':
| fbgc.c:92:19: warning: variable 'yOff' set but not used [-Wunused-but-set-variable]
| fbgc.c:92:13: warning: variable 'xOff' set but not used [-Wunused-but-set-variable]
| fbgc.c: In function 'fbCanEvenStipple':
| fbgc.c:166:23: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
| fbgc.c:166:13: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]
|   CC     libfb_la-fbpush.lo
| fbpush.c: In function 'fbPushPixels':
| fbpush.c:238:20: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable]
| fbpush.c:238:10: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable]

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-16 00:43:50 +02:00
Cyril Brulebois 8da16898d9 fb: Simplify logic, get rid of set but unused variable.
wrapped is only useful is FB_ACCESS_WRAPPER is set; simplify the logic
accordingly, and only set it when that's defined.

The following warning goes away accordingly:
|   CC     libfb_la-fbarc.lo
| fbarc.c: In function 'fbPolyArc':
| fbarc.c:71:11: warning: variable 'wrapped' set but not used [-Wunused-but-set-variable]

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-16 00:43:49 +02:00
Alan Coopersmith 1b2d17748f fbbltone.c: Mark bitmasks as unsigned ints
Clears many Sun compiler warnings:
"fbbltone.c", line 491: warning: integer overflow detected: op "<<"
"fbbltone.c", line 491: warning: integer overflow detected: op "<<"
"fbbltone.c", line 491: warning: integer overflow detected: op "<<"
"fbbltone.c", line 491: warning: initializer will be sign-extended: -16777216
"fbbltone.c", line 491: warning: integer overflow detected: op "<<"
"fbbltone.c", line 491: warning: initializer will be sign-extended: -1
"fbbltone.c", line 495: warning: integer overflow detected: op "<<"
"fbbltone.c", line 495: warning: integer overflow detected: op "<<"
"fbbltone.c", line 495: warning: integer overflow detected: op "<<"
"fbbltone.c", line 495: warning: initializer will be sign-extended: -256
"fbbltone.c", line 495: warning: integer overflow detected: op "<<"
"fbbltone.c", line 495: warning: initializer will be sign-extended: -1
"fbbltone.c", line 499: warning: integer overflow detected: op "<<"
"fbbltone.c", line 499: warning: integer overflow detected: op "<<"
"fbbltone.c", line 499: warning: integer overflow detected: op "<<"
"fbbltone.c", line 499: warning: initializer will be sign-extended: -65536
"fbbltone.c", line 499: warning: integer overflow detected: op "<<"
"fbbltone.c", line 499: warning: initializer will be sign-extended: -1

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-05-25 09:35:39 -06:00
Keith Packard ec9ea40178 Merge remote-tracking branch 'jeremyhu/master' 2011-04-27 12:01:56 -07:00
Jeremy Huddleston fd086f87cd fb: Silence warnings when building with clang
fbpict.c:163:8: warning: implicit conversion from enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different enumeration
      type 'pixman_format_code_t' [-Wconversion]
        pict->format,
        ~~~~~~^~~~~~

fbbltone.c:486:2: warning: shift result (281474959933440) requires 49 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
        C2_24( 0, 0), C2_24 ( 1, 0), C2_24 ( 2, 0), C2_24 ( 3, 0),
        ^~~~~~~~~~~~
fbbltone.c:474:6: note: instantiated from:
     SelMask24(b,1,r))
     ^
fbbltone.c:429:46: note: instantiated from:
                                                    ^
fbbltone.c:427:18: note: instantiated from:
                      0xffffff << Mask24Check(x,r)) : 0)
                      ~~~~~~~~ ^

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-25 10:45:34 -07:00
Søren Sandmann Pedersen c6cb70be1e Fix trapezoid and triangle rendering to windows
For fbAdd{Traps,Triangles}() and fbRasterizeTrapezoid() this is just a
matter of adding the image offsets to the trap offsets.

For fbShapes, the story is more complicated:

The recently added pixman API did not allow offsetting
trapezoids. Instead, it would use x_dst and y_dst in such a way that
the effect was to only offset the source image.

In pixman 0.21.8, this API has changed such that all the traps are
conceptually rendered to an infinitely big image, and the source and
destination coordinates are then aligned with (0, 0) of that
image. This means offsetting dst_x and dst_y will now offset the
entire drawing, which is similar to how other composite functions
work.

This patch then changes fbComposite{Triangles,Traps} such that the
source image is aligned with the shapes, and the destination
coordinates offset according to drawable->{x, y}.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22 22:11:20 -04:00
Søren Sandmann Pedersen 1b96a99d8e fb: Call miCompositeSourceValidate() on the source in fbShapes()
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22 22:11:11 -04:00
Søren Sandmann Pedersen c7bce22b58 Track damage for fbTrapezoids() and fbTriangles().
These calls no longer go through the CompositePicture() hook, so
damage was no longer generated for them. This patch simply damages the
entire destination clip region.

It would be possible to generate tighter damage for certain operators
such as Over and Add, where blank source pixels have no effect on the
destination, but given that virtually all trapezoid rendering takes
place on pixmaps, it's unlikely that anybody would actually benefit
from this optimization, and the miTrapezoidBounds function did
sometimes show up on profiles, probably because it does several
divisions per trapezoid.

V2: Call DamageRegionProcessPending() - pointed out by Michel Dänzer.
V3: Call DamageRegionProcessPending() *after* rendering -
        pointed out by Maarten Maathuis

Reviewed-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-04-22 21:37:58 -04:00
Tiago Vignatti 2aa935bc5c fb: fix memory leak in fbOverlayFinishScreenInit
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-04 15:41:13 +03:00
Tiago Vignatti dce2f10cf7 mi: fix memory leak in miInitVisuals
Free the pointers inside miInitVisuals, so the callers of this function
(fboverlay.c and fbscreen.c) don't need to worry with deallocation in the case
of failure.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-04 15:41:13 +03:00
Dave Airlie f9834d312e fb: cleanup fbChangeWindowAttributes
This cleans up the duplication in fbChangeWindowAttributes,
and fixes a bug if the fb24_32ReformatTile ever failed,
since the old code would happily dereference it in the fbEvenTile
call a few lines later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-04-01 11:02:17 +10:00
Dave Airlie 36c7158133 fb: drop comments around 24-bit support.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-04-01 10:32:27 +10:00
Dave Airlie ac2ae2ed37 fb: add back fb defines for driver compat.
we could drop these really and just fixup the drivers, but
since they'll build fine but fail to work this seems safer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-04-01 10:31:07 +10:00
Dave Airlie be9cfb249d fb: drop defines that aren't used/necessary anymore.
This was generated by:
cd fb
coan source --replace -DFB_SCREEN_PRIVATE -DFB_24BIT -DFB_24_32BIT -DFB_SCREEN_PRIVATE -UFBNOPIXADDR -UFBNO24BIT -UFBNO24_32 *.[ch]

A follow up patch readds the FB_24_32BIT define for Intel UXA.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-04-01 10:28:06 +10: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
Søren Sandmann Pedersen 57b35adaed Remove geometry arguments from miSourceValidate()
The only user of the geometry coordinates is the software sprite code,
which uses them to remove the pointer whenever the window beneath is
being used as a source. However, using Window pictures as a source is
extremely rare (let alone *partial* windows), so there is no harm done
in just validating all of the drawable.

Additionally, the miSourceValidate() function was buggy in at least
three respects:

(a) It added drawable->{x,y} before calling down, which is wrong since
    the misprite code already adds them in its check. (Alternatively,
    the misprite code is wrong, but there are actual users who would
    notice if that code was broken).

(b) It didn't account for the width of the interpolation filter, so if
    the Picture had a bilinear or convolution filter, the edges
    surrounding the source area would not be validated.

(c) It didn't validate alpha maps.

Finally, computing the bounding box of the transform on every
composite request was a real performance issue in pixman, so
presumably it could be one here as well.

This patch changes miSourceValidate() to simply validate all of the
underlying drawable.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-03-14 13:57:42 -04: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
Søren Sandmann Pedersen 7dff79e395 Implement fbAddTriangles() in terms of pixman_add_triangles()
This allows the remaining triangle-to-trap conversion code to be
deleted.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-02-26 13:58:54 -05:00
Søren Sandmann Pedersen 566f1931ee Move miTriangles to fb as fbTriangles()
The fb version simply calls the new pixman_composite_triangles(). This
allows us to get rid of miCreateAlphaPicture().

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-02-26 13:58:54 -05:00
Søren Sandmann Pedersen 788ccb9a8b Move miTrapezoids() into fb as fbTrapezoids()
The main consumer of trapezoids, cairo, is using the Trapezoids
request, which is currently implemented in the miTrapezoids()
function. That function splits the request into smaller bits and calls
lower level functions such as AddTrap.

By moving the implementation of the whole request into fb, we can
instead call pixman_composite_trapezoids() to do the whole request in
one step.

There are no callers of miTrapezoids in any of the open source
drivers, although exa and uxa have their own copies of the function.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-02-26 13:58:53 -05:00
Adam Jackson 59d8e3cbdb fb: Remove hw/xfree86/ from includes
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-08 12:41:13 -05:00
Alan Coopersmith 2db6951763 Sun's copyrights now belong to Oracle
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07 11:10:35 -08:00
Jesse Adkins 84e8de1271 fb: Remove fbcmap.c (bug 5436)
This is obsolete since a240c039c4.
Updated fb.h to mention that the functions come from fbcmap_mi.c now.
Dropped fbcmap.c from the makefile.

Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-11-10 21:37:24 -08:00
Søren Sandmann Pedersen 3dc3aefb88 fb: Delete a bunch more left-overs
All of these definitions were unused since compositing moved to pixman.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-02 03:36:45 -04:00
Søren Sandmann Pedersen 565b5e2b02 wfb: Delete unused renamings
These functions haven't existed in a while.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-02 03:36:45 -04:00
Søren Sandmann Pedersen 0dae479e16 fb: Delete fbCompositeGeneral()
This function was an unused and trivial wrapper around fbComposite().

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-02 03:36:45 -04:00
Søren Sandmann Pedersen 74bc2d8c6b render: Delete renderedge.[ch]
The functions in these files have not been used since trap
rasterization was moved to pixman. They survived until now to preserve
the server abi.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-01 22:54:18 -04:00
Søren Sandmann Pedersen 6118346d64 Delete unused fbWalkCompositeRegion()
This function has not been used since most of the compositing was
moved to pixman. The only reason it has survived until now is that it
was part of the server ABI.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-01 22:04:49 -04:00
Alan Coopersmith 1333e101b4 Remove leftover fbSaveAreas & fbRestoreAreas defines from wfbrename.h
The fb functions they try to rename were deleted in 2007 by
commit ae7f71a8b3

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-13 09:16:51 -07:00
Jamey Sharp bbbf795e6b Delete redundant GC initializations.
When a GC is allocated, it is zeroed, including all storage requested
with dixRegisterPrivateKey. So CreateGC hooks don't need to initialize
anything to zero.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-09-13 15:55:17 -07:00
Jamey Sharp f856dcdc3a Delete unused lastWinOrg field from GCs.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-13 15:55:17 -07:00
Jamey Sharp 5ff9e58bef fb: Delete unused oneRect private field.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-13 15:55:16 -07:00
Keith Packard 3e56efcfb6 fb: make isClipped always reject negative coordinates (bug 11503)
A window with either dimension > 32767 can be positioned such that
coordinates > 32767 are visible on the screen. Attempts to draw to
those pixels will generate coordinates wrapped around to negative
values.

The optimized clipping macro, 'isClipped', in fbbits.h, computes
clipping in window space rather than screen space using int16 values,
and so it too has coordinates wrapped around to negative values and
hence ends up accepting the wrapped drawing coordinates.

Two possible fixes for this problem

 1) Detect wrapped region coordinates and clip those to 32767.
 2) Detect negative incoming coordinates and reject those

This patch takes the second approach as it is much shorter, simply
detecting when either X or Y incoming coordinate is negative, which
can never be 'within' any drawable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-08-20 10:01:48 -07:00
Keith Packard ff70848e62 Don't let alpha maps recurse in fb. Bug 23581.
Recursive alpha maps (where one picture's alpha map is set to a
picture with an external alpha map) would be all fine and dandy,
except for the case where the client constructs a loop. Detecting this
case when setting the alpha map values would be difficult as any time
an alpha map is set, the server would have to check for the looping
case.

Instead, a far simpler fix is to simply disallow recursive alpha maps
in the rendering code, the Render spec is ambiguous in this area and
allows us to to ignore the recursive case.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-08-10 09:18:22 -07:00
Alan Coopersmith c5eb5d69e5 Record some additional library dependencies in xf86 modules
Helps with symbol resolution when building with -z defs

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-10 19:01:22 -07:00
Mikhail Gusarov 7287ef9e6c Remove unnecessary parentheses around return values in functions
This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10 06:42:42 -07:00
Jamey Sharp a0fe6987b5 Clean up after removal of screen parameters from region macros.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05 22:07:21 -07:00
Keith Packard faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Keith Packard 2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Keith Packard 9b6f5f549d Change region implementation names to eliminate the 'mi' prefix
This prepares the file to be moved from mi to dix. This patch
was done mechanically with the included scripts 'fix-miregion' run over
the entire X server and 'fix-miregion-private' run over
include/regionstr.h and mi/miregion.c.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 17:47:32 -07:00
Jamey Sharp e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp 6a84cd9434 Replace dixChangeGC with calls directly to the right variant.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:14:07 -07:00
Jamey Sharp e2929db7b7 dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.
The exceptions are ProcChangeGC and CreateGC.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13 17:13:48 -07:00
Jamey Sharp 65cedf3905 Kill DoChangeGC in favor of dixChangeGC.
This doesn't change any behavior, but it isn't clear whether NullClient
is correct in all cases. As ajax says,

> For most of these changes, I think it's correct to use NullClient,
> since they are server-initiated changes and should not fail for (eg)
> xace reasons. ... At any rate, you're certainly not changing any
> semantics by leaving them all as NullClient, so this patch can't be
> more wrong than before.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-12 18:09:55 -07: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
Jamey Sharp a2c716eaf6 fb: track screens' installed colormaps as screen privates.
Several DDXes allow each screen to have at most one (or in some cases,
exactly one) installed colormap. These all use the same pattern: Declare
a global-lifetime array of MAXSCREENS ColormapPtrs, and index it by
screen number. This patch converts most of those to use screen privates
instead.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-04-23 15:32:19 +03: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
Oliver McFadden aeae6637b5 fb: fbFinishScreenInit: leaked_storage: Variable "(visuals|depths)" goes out of scope
Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-21 15:20:27 -07:00
Pierre-Loup A. Griffais a6bd5d2e48 Fix source pictures getting random transforms after 2d6a8f6683.
*xoff and *yoff were uninitialized for source-only pictures.x

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 14:03:03 -08:00
Alan Coopersmith c9726bbe31 Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-16 17:11:35 -08:00
Keith Packard a72c65e917 fb: Adjust transform or composite coordinates for pixman operations
Windows (or even pixmaps, in some cases) may not sit at the origin of
the containing pixmap, so any coordinates relative to the drawable
must be adjusted. For destinations and untransformed sources, the
operation coordinates are adjusted. For transformed sources, the
transform matrix is adjusted.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:45 -08:00
Keith Packard bd567061c8 Split fbGetDrawable into fbGetDrawablePixmap and fbGetPixmapBitsData
These two sub-macros each perform half of the original macro work and
the old macro is now implemented in terms of the new ones. This makes
way for new code which wants to know the underlying pixmap for a
window instead of just getting a pointer to the bits.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:28 -08:00
Keith Packard 6133505297 Revert "Fix clipping when windows are used as sources"
This reverts commit e9aa61e9f0.

Conflicts:

	fb/fbpict.c

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:22 -08:00
Keith Packard 071b3c1810 Revert "Use IncludeInferiors when copying windows before compositing."
This reverts commit 7c7f0c2c6a.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:14 -08:00
Keith Packard 8e640d6b13 Revert "Reserve space for two GC values in copy_drawable()."
This reverts commit 08df24555c.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:00 -08:00
Keith Packard 0816c5482c Revert "fb: Don't crash if copy_drawable() returns NULL."
This reverts commit 66a9616d64.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:49:38 -08:00
Michel Dänzer 66a9616d64 fb: Don't crash if copy_drawable() returns NULL.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24634 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-30 08:37:12 -08:00
Soeren Sandmann f450be9992 Add xoff and yoff to drawable->x and drawable->y in create_bits_picture().
These are 0, except when the drawable is a redirected window.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-14 16:09:37 +10:00
Eamon Walsh 1bdc9ec617 Fix "warning: left-hand operand of comma expression has no effect"
Signed-off-by: Eamon Walsh <efw@eamonwalsh.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-07 11:00:50 +10:00
Michel Dänzer 842373104d Add support for RENDER BGRA formats. 2009-08-04 23:23:21 +02:00
Soren Sandmann Pedersen 08df24555c Reserve space for two GC values in copy_drawable().
Pointed out by Pierre Willenbrock.
2009-07-09 17:23:04 -04:00
Søren Sandmann Pedersen 7c7f0c2c6a Use IncludeInferiors when copying windows before compositing.
Part of bug 22484.
2009-07-06 13:06:50 -04:00
Søren Sandmann Pedersen e9aa61e9f0 Fix clipping when windows are used as sources
The new clipping rules:

	- client clips happen after transformation
	- pixels unavailable due to the hierarchy are undefined

The first one is implemented in pixman; the second one is realized by
making a copy of window sources (to prevent out-of-bounds access).
2009-06-18 12:36:11 -04:00
Søren Sandmann Pedersen ebfd6688d1 Make compositing with transformed windows work again.
The coordinate translation was broken in pretty much every way
imaginable.
2009-05-10 23:27:56 -04: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
Maarten Maathuis 734b23e598 fb: add fbDoCopy and fbCopyRegion compatibility wrappers. 2009-02-11 14:35:17 +01:00
Maarten Maathuis 2e76958d30 fb: move some code to mi 2009-02-06 18:42:39 +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 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 180bad8477 Add visibility flags to XSERVER_CFLAGS.
This is done to actually change DIX_CFLAGS, as not all "modules" use
XORG_CFLAGS.
  Also export the symbols that are required by other modules after
the change.
2008-12-02 02:50:45 -02: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
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
Jeremy Huddleston 9c5fc7762e Partially reverts commit 505c216d03.
I don't know how the hell git-cherrypick messed that up to delete fbwindow.c
2008-10-03 11:24:34 -07:00
Jeremy Huddleston 505c216d03 Added dep on applewmproto 1.1.0
(cherry picked from commit b350b06674)
2008-10-03 11:11:37 -07:00
Adam Jackson b1a3173473 Fix bad preprocessor line 2008-10-02 17:03:21 -04:00
Tomas Carnecky ebea78cdba Prepare for array-index based devPrivates.
TODO: static indices can be made just an int; some indices
can be combined.
2008-08-28 18:05:40 -04:00
Adam Jackson 856db05b58 Unifdef sgi. 2008-07-23 13:37:42 -04:00
Daniel Stone 446fe9eecd Dead code removal
Remove a whole bunch of code that was never built, be it entire files or
just dead ifdefs.
2008-07-17 21:37:50 +03:00
Adam Jackson 9719354ae0 Check for __amd64__, not __x86_64__.
Spiritual revert of 1fa4de80fc.  Intel's C
compiler claims to be gcc-compatible; if they're not defining the same
macros as gcc then that's their bug, not ours.  Even if we were to do
this aliasing we should do it once and for all in servermd.h.
2008-06-24 14:37:06 -04:00
Adam Jackson b55fbca4f0 Bug #12414: Create full-fledged pixmaps in fb24_32ReformatTile().
... instead of creating pixmaps that only fb knows about, which will
have no devPrivates for any other subsystem and thus cause havoc if
(when) they leak out.
2008-06-20 13:27:32 -04:00
Eamon Walsh 60f64af075 Fix "warning: passing argument 1 of 'pixman_fill' from incompatible pointer type". 2008-06-13 21:23:31 -04:00
Adam Jackson f31bd087e8 Death to mfb.
Anyone still interested in 1 or 4 bpp framebuffers, talk to fb.
2008-06-13 10:51:18 -04:00
Peter Hutterer e73a03d589 fb: shut up two compiler warnings. 2008-05-20 10:54:32 +09:30
Tilman Sauerbeck d3d00d9258 Removed fbpseudocolor.h from sdk_HEADERS. 2008-04-19 12:54:40 +02:00
Adam Jackson 5bdc419879 Remove fbpseudocolor
"An experimental pseudocolor emulation layer.  Not fully completed,
currently only works for 16bpp."  That was almost four years ago.
It still doesn't work, only one driver even attempts to use it, it
contains an ad-hoc implementation of damage, and should really be
done up in Composite now anyway.
2008-04-19 04:06:19 -04:00
Matt Turner 1fa4de80fc Check for __x86_64__ when we check for __amd64__
It seems Intel C Compiler neglects to define __amd64__, __amd64, or
amd64, but *does* define __x86_64__.
2008-04-12 20:39:18 +02:00
Adam Jackson 24bebdded4 fbFillRegionTiled() is now dead code.
Only ever called from the old PaintWindow* screen hooks, but those are
gone now.  As a pleasant side effect, fb loses its #ifdef PANORAMIX.
2008-02-22 15:22:38 -05:00