Commit Graph

102 Commits

Author SHA1 Message Date
Adam Jackson
8171d4c2d6 render: Store and use all 16bpc of precision for solid pixels (v2.1)
This plumbs the full width color for solid pictures through to fb, exa,
and glamor. External drivers and acceleration code may wish to make a
similar change for sufficiently new servers.

v2: Don't break ABI (Michel Dänzer)
v2.1: Use the (correct) full color in fb too (Michel Dänzer)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-26 16:46:34 -05:00
Maarten Lankhorst
c6511d0142 exa: only draw valid trapezoids
Fixes freedesktop.org bug https://bugs.freedesktop.org/show_bug.cgi?id=67484

If t->bottom is close to MIN_INT, removing top can wraparound, so do the check properly.
A similar fix should also be applied to pixman.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-17 11:21:30 +02:00
Dave Airlie
4c7cefe240 exa: initialise mask_off_x and mask_off_y
These get used at the end of the function in a calculation,
even though the result isn't used its not pretty.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-23 10:43:39 -04:00
Peter Hutterer
732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Keith Packard
9c108b3ccd exa: Fix -Wshadow warnings
In exa_accel, there was a duplicate fetch of a pixmap private field.

exa_render just had a regular shadowed value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

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

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

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

The comparison was done with this script:

dir1=$1
dir2=$2

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

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

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

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Keith Packard
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
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
Maarten Maathuis
a54c23fe64 exa: s/PixmapIsOffscreen/PixmapHasGpuCopy and s/pExaPixmap->offscreen/pExaPixmap->use_gpu_copy
- Fixup some variable names as well.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-28 12:44:58 -08:00
Michel Dänzer
1088073b11 EXA: Fix exaTryDriverSolidFill() for solid source pictures.
Solid pictures have a NULL pFormat field, but their format is always
PICT_a8r8g8b8.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-09 18:04:30 -07:00
Ben Skeggs
55305cf8db EXA: fix exaGetRGBAFromPixel to not loop forever on PICT_a8 picture
Easily reproducible by running "rendercheck -t fill".

It should be safe to just test against rbits for all colour components
as we should always have values for r/g/bbits for PICT_FORMAT_COLOR
formats.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Michel Dänzer <daenzer@vmware
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-09 16:08:15 -07:00
Michel Dänzer
096f21bb7a EXA: Fix some issues pointed out by clang.
Remove dead variables, fix use of uninitialized values, that kind of thing.
2009-09-23 08:24:06 +02:00
Michel Dänzer
be37f339a9 EXA: Stop hiding solid or gradient pictures from the driver.
Add support for solid pictures in exaTryDriverSolidFill(), but otherwise just
pass solid and gradient pictures to the driver Composite hook.

While we're at it, clean up the logic to detect Composite operations which are
effectively solid fills or copies. This should also fix some false negatives
and positives.
2009-09-04 23:11:13 +02:00
Maarten Maathuis
03ecb164f2 exa: A simple 3rd backend implementation.
- Based on driver pixmaps with some changes (completely transparent to driver).
- It helps with the problem of known software fallbacks, such as trapezoids.
- exaDoMigration is now called for all cases that provide a do_migration hook.
- exa_migration.c is renamed to exa_migration_classic.c
2009-08-06 23:48:14 +02:00
Michel Dänzer
842373104d Add support for RENDER BGRA formats. 2009-08-04 23:23:21 +02:00
Michel Dänzer
de7a14ca92 EXA: Fix up some issues introduced by 00fe4a2977.
* Check all pixmaps involved for damage records, fixes visual corruption due to
  the screen pixmap never having one.
* Fix an array size and remove a now superfluous assignment.
2009-07-21 12:55:27 +02:00
Michel Dänzer
00fe4a2977 EXA: Completely eliminate exaDoMigration calls for drivers that manage pixmaps. 2009-07-20 02:04:40 +02:00
Michel Dänzer
850675d4de EXA: Take GC client clip type into account for migration.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18950 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-15 15:48:37 +02:00
Michel Dänzer
9d5141f7bc EXA: No longer use the driver UploadToScratch hook.
See http://bugs.freedesktop.org/show_bug.cgi?id=20213 .

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

Conflicts:

	exa/exa_render.c
2009-02-27 16:37:27 +01:00
Michel Dänzer
f07f18231a EXA: Allow using exaCompositeRects also when we can't use a mask in exaGlyphs.
This should give the full benefits of the glyph cache even when we can't use a
mask.

This also means we no longer need to scan the glyphs to see if they overlap,
we can just use a mask or not as the client asks.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-26 10:35:44 +01:00
Michel Dänzer
170cf1270d EXA: Handle separate alpha maps properly in Composite fallback.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 .

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

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

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-24 09:22:09 +01:00
Maarten Maathuis
68665d78e7 exa: don't use fbCopyNtoN 2009-02-06 18:42:39 +01:00
Maarten Maathuis
2db7b66863 exa: a few cleanups
- Some warnings silenced.
- Some whitespace cleanup.
2008-12-19 23:12:37 +01:00
Michel Dänzer
21c116219c Fix typos which caused exaCompositeRects() to use an incorrect damage region.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18065 .

Also, it can bail if either width or height of the bounding box is <= 0, not
only if both of them are.
2008-11-08 01:25:14 +01:00
Maarten Maathuis
87a016ae00 exa: restore {x,y}{Src,Dst} to their original values when !done 2008-10-15 00:03:16 +02:00
Maarten Maathuis
a29af64658 exa: remove "direct" case for exa{Trapezoids,Triangles}
- By adding a small hack to the xserver i was able to easily test the performance of the normally rare direct case (using cairo).
- It turned out to be 70% slower for me (large test on an otherwise idle computer), which seems enough of a reason to remove it.
- AddTraps could also use a 2nd look, but since noone is using that it's a bit hard and less useful to test.
2008-10-03 23:59:06 +02:00
Maarten Maathuis
416870d8c9 exa: remove some excessive whitespace 2008-10-03 23:59:06 +02:00
Maarten Maathuis
f4e9a1a98f damage: choose less ambiguous function names 2008-08-31 17:46:26 +02:00
Maarten Maathuis
1861250cd7 {damage,exa}: sanitise damage
- Redo damage naming for more consistency.
- Call post submission functions only where appropriate.
- EXA can now live without it's odd damage workarounds.
2008-08-29 22:15:23 +02:00
Maarten Maathuis
dd1e54d6ee exa: fix thinko from 988725f32e
- the drawable of the pixmap is not the same as the original drawable (possibly a DRAWABLE_WINDOW)
2008-08-26 20:02:55 +02:00
Maarten Maathuis
de79edbd9f exa: report damage manually for exa{Trapezoids,Triangles} when needed
- Plus a micro cleanup of unused variables.
2008-08-26 17:56:40 +02:00
Maarten Maathuis
988725f32e exa: move destination damage for internal calls to a special function
- This should improve clarity for someone who isn't familiar with the code.
2008-08-26 17:56:40 +02:00
Michel Dänzer
4212599c92 EXA: Make sure damage tracking code is inactive if the driver manages pixmaps.
It was always supposed to be like that... It was only recently pointed out (in
a rather convoluted way) that it was not in fact the case.
2008-08-08 12:17:58 +02:00
Michel Dänzer
3b8d53452c EXA: Fall back in CompositeRects if the driver can't accelerate Composite.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=15780 .
2008-05-01 15:10:52 +02:00
Owen Taylor
40eb14c948 EXA: Add exaCompositeRects()
Add a function to composite multiple independent rectangles
from the same source to the same destination in a single
operation: this is useful for building a glyph mask.
2008-04-28 21:00:54 +02:00
Tilman Sauerbeck
bb8868540f EXA: Teach exaCompositeFallbackPictDesc() about x8r8g8b8. 2008-04-14 12:48:13 +02:00
Owen W. Taylor
6b1a27023e EXA: Fix TS origin computation when implementing RenderComposite with tiling. 2008-04-07 11:01:09 +02:00
Maarten Maathuis
f6d51797a5 EXA: Let the driver decide what repeat/extend types are supported. 2008-02-27 23:44:39 +01:00
Eric Anholt
5cb9e15562 EXA: Fix Render acceleration in copy and tiling cases.
Code shuffling in a634c9b034 broke this by
leaving pSrcPixmap = NULL.
2008-02-20 10:36:06 -08:00
Aaron Plattner
f2e310132f Add CreatePixmap allocation hints.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
2007-11-04 16:11:28 -08:00
Eric Anholt
4b14c9a9cd Replace calls to Glyphs screen hook with CompositeGlyphs and remove dead code.
Not all of the DDX/miext Glyphs hook implementations have been removed, but
they should be.
2007-10-19 16:34:54 -07:00
Eric Anholt
a3a95d3475 Merge branch 'master' into glyph-pixmaps
Conflicts:

	configure.ac
2007-10-19 15:44:17 -07:00
Michel Dänzer
ce50bfd336 EXA: Skip empty glyphs. 2007-10-18 17:44:48 +02:00
Michel Dänzer
5d74416740 EXA: Don't attempt to move in pixmaps that can't be accelerated.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12815 .
2007-10-18 17:44:14 +02:00
Eric Anholt
439edc768e Merge branch 'glyph-pixmaps'
Conflicts:

	configure.ac
	exa/exa_render.c
2007-10-02 12:14:04 -07:00
Tilman Sauerbeck
56ffc381d3 EXA: Removed duplicated exaGetDrawablePixmap() calls. 2007-09-26 16:52:27 +02:00
Tilman Sauerbeck
ae8b4f7dcf EXA: Added pitch limitations.
Drivers can now specify the max pitches that the accelerator supports.
2007-09-25 16:43:06 +02:00
Michel Dänzer
5f7da4da8d EXA: Use exaShmPutImage for pushing glyphs to scratch pixmap in exaGlyphs. 2007-09-07 18:41:33 +02:00