summaryrefslogtreecommitdiff
path: root/fb
AgeCommit message (Collapse)AuthorFilesLines
2012-08-14fb: reorder Bresenham error correction to avoid overshoot.Simon Schubert1-9/+9
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-07-05Use new screen-specific privates for fb window and gc privatesKeith Packard6-41/+25
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-06-05api: rework the X server driver API to avoid global arrays.Dave Airlie4-4/+4
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-03-21Introduce a consistent coding styleKeith Packard36-8026/+6499
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>
2011-10-04Fix server crash due to invalid imagesKirill Elagin1-1/+3
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-09-21fb: Rename wfbTriangles and wfbTrapezoidsAaron Plattner1-0/+2
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-08-15fb: Fix memcpy abuseAdam Jackson1-2/+7
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-06-16fb: Mark some variables as unused.Cyril Brulebois4-8/+8
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:100:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100: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-16fb: Simplify logic, get rid of set but unused variable.Cyril Brulebois1-6/+3
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-05-25fbbltone.c: Mark bitmasks as unsigned intsAlan Coopersmith1-2/+2
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-04-27Merge remote-tracking branch 'jeremyhu/master'Keith Packard2-1/+6
2011-04-25fb: Silence warnings when building with clangJeremy Huddleston2-1/+6
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-22Fix trapezoid and triangle rendering to windowsSøren Sandmann Pedersen1-29/+27
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-22fb: Call miCompositeSourceValidate() on the source in fbShapes()Søren Sandmann Pedersen1-0/+2
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22Track damage for fbTrapezoids() and fbTriangles().Søren Sandmann Pedersen1-0/+5
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-04fb: fix memory leak in fbOverlayFinishScreenInitTiago Vignatti1-2/+6
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-04mi: fix memory leak in miInitVisualsTiago Vignatti1-4/+0
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-01fb: cleanup fbChangeWindowAttributesDave Airlie1-35/+20
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-01fb: drop comments around 24-bit support.Dave Airlie1-6/+0
Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2011-04-01fb: add back fb defines for driver compat.Dave Airlie1-0/+3
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-01fb: drop defines that aren't used/necessary anymore.Dave Airlie21-155/+0
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-03-17Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class"Keith Packard3-7/+9
This reverts commit 1564c82417d201de5b9a5ec5e7aa4ef14c45fbad. 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-14Remove geometry arguments from miSourceValidate()Søren Sandmann Pedersen1-2/+2
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-08dix: Remove usage_hint from pixmaps, store it in ->drawable.classAdam Jackson3-9/+7
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-02-26Implement fbAddTriangles() in terms of pixman_add_triangles()Søren Sandmann Pedersen1-82/+9
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-26Move miTriangles to fb as fbTriangles()Søren Sandmann Pedersen3-31/+89
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-26Move miTrapezoids() into fb as fbTrapezoids()Søren Sandmann Pedersen3-3/+91
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-08fb: Remove hw/xfree86/ from includesAdam Jackson1-4/+0
Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-12-07Sun's copyrights now belong to OracleAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-11-10fb: Remove fbcmap.c (bug 5436)Jesse Adkins3-588/+2
This is obsolete since a240c039c47c0be22ea5e100692307b26d938747. 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-02fb: Delete a bunch more left-oversSøren Sandmann Pedersen2-381/+0
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-02wfb: Delete unused renamingsSøren Sandmann Pedersen1-15/+0
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-02fb: Delete fbCompositeGeneral()Søren Sandmann Pedersen2-35/+0
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-01render: Delete renderedge.[ch]Søren Sandmann Pedersen2-4/+0
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-01Delete unused fbWalkCompositeRegion()Søren Sandmann Pedersen3-124/+0
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-10-13Remove leftover fbSaveAreas & fbRestoreAreas defines from wfbrename.hAlan Coopersmith1-2/+0
The fb functions they try to rename were deleted in 2007 by commit ae7f71a8b3d6756161e55d998d6eec37d2695c98 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-09-13Delete redundant GC initializations.Jamey Sharp1-7/+1
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-13Delete unused lastWinOrg field from GCs.Jamey Sharp1-3/+0
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-13fb: Delete unused oneRect private field.Jamey Sharp2-2/+0
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-08-20fb: make isClipped always reject negative coordinates (bug 11503)Keith Packard1-1/+1
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-10Don't let alpha maps recurse in fb. Bug 23581.Keith Packard1-6/+18
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-06-10Record some additional library dependencies in xf86 modulesAlan Coopersmith1-0/+2
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-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov3-4/+4
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-05Clean up after removal of screen parameters from region macros.Jamey Sharp3-21/+12
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard7-50/+40
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-05Rename region macros to eliminate screen argumentKeith Packard19-67/+67
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-05Change region implementation names to eliminate the 'mi' prefixKeith Packard1-2/+2
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-03Move each screen's root-window pointer into ScreenRec.Jamey Sharp1-1/+1
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-05-13Replace dixChangeGC with calls directly to the right variant.Jamey Sharp1-1/+1
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.Jamey Sharp1-1/+3
The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>