Age | Commit message (Collapse) | Author |
|
Masks with no RGB components but have their component alpha property
set are not component alpha because there are no components present to
specify the alpha of each channel. Treat these as standard masks.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
The bug previously identified as RGB565 specific affects more than just
that format - any destination format with a reduced number of alpha
bits seems to trigger the bug. Widen the test to include all non-
8-bit alpha formats.
The test for using source alpha was also wrong.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
Ensure all pending operations have been committed and waited to
complete when shutting down to avoid segfaults when cleaning up.
This can happen when trying to free the screen pixmap, which may
be in a fenced state.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
If etnaviv_accel_reduce_mask() succeeded in replacing the mask by
constant alpha the source format still needs to be switched to an
alpha one to get correct swizzles. We only want to avoid clobbering
the alpha mode setup done by etnaviv_accel_reduce_mask().
Found via rendercheck on GC320:
Over composite test error of 255.0000 at (3, 23) --
R G B A
got: 1.000 0.000 1.000 1.000
expected: 1.000 0.000 0.000 1.000
src color: 1.00 0.00 0.00 1.00
msk color: 1.00 1.00 1.00 1.00
dst color: 1.00 1.00 1.00 1.00
src: 10x10 b8g8r8x8, mask: 1x1R a8r8g8b8, dst: x8r8g8b8
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[edited description to include details of the failure, and improved
comment --rmk]
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
Ensure that the mask format used for the IN operation is supported by
the GPU. We need to fallback for unsupported formats.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
The composite operation is defined to be:
(src IN mask) OP dst
The IN operation is: Fa = A(mask), Fb = 0, which gives an equation of:
C = C(src) * A(mask) + C(mask) * 0
When the mask has no alpha channel, A(mask) is defined to be 1.0, so
this becomes:
C = C(src)
meaning that the resulting composite operation becomes:
src OP dst
We can make use of the more efficient etnaviv_accel_composite_srconly()
path to perform this operation as it has no dependency on the mask.
This fixes this rendercheck failure on GC600:
Src composite test error of 255.0000 at (1, 0) --
R G B A
got: 0.000 0.000 0.000 0.000
expected: 1.000 1.000 1.000 1.000
src color: 1.00 1.00 1.00 1.00
msk color: 1.00 1.00 1.00 1.00
dst color: 1.00 1.00 1.00 1.00
src: 1x1R a8r8g8b8, mask: 10x10 x8r8g8b8, dst: a8r8g8b8
and this failure on GC320:
Src composite test error of 255.0000 at (1, 3) --
R G B A
got: 0.000 0.000 0.000 0.000
expected: 1.000 1.000 1.000 1.000
src color: 1.00 1.00 1.00 1.00
msk color: 1.00 1.00 1.00 1.00
dst color: 1.00 1.00 1.00 1.00
src: 10x10 x8r8g8b8, mask: 10x10 x8r8g8b8, dst: a8r8g8b8
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
The blit into the temporary pixmap needs the same workaround for
non-alpha formats as all other blits.
Found via rendercheck, the failing test reports on GC600:
InReverse composite test error of 255.0000 at (6, 3) --
R G B A
got: 0.000 0.000 0.000 0.000
expected: 1.000 1.000 1.000 1.000
src color: 1.00 1.00 1.00 1.00
msk color: 1.00 1.00 1.00 1.00
dst color: 1.00 1.00 1.00 1.00
src: 10x10 x8r8g8b8, mask: 10x10 a8r8g8b8, dst: a8r8g8b8
and GC320:
InReverse composite test error of 255.0000 at (6, 7) --
R G B A
got: 0.000 0.000 0.000 0.000
expected: 1.000 1.000 1.000 1.000
src color: 1.00 1.00 1.00 1.00
msk color: 1.00 1.00 1.00 1.00
dst color: 1.00 1.00 1.00 1.00
src: 10x10 b8g8r8x8, mask: 10x10 a8r8g8b8, dst: a8r8g8b8
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[edited description to include details of the failure, dropped now
unnecessary format reset. --rmk]
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
Lucas Stach reports that we were overwriting the mask coordinates when
getting the drawable. This means we end up ignoring the requested mask
coordinates, translation, and drawable position.
This is a simplified version of Lucas' original patch.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
|
|
The calculation of the space required for the VR op was incorrect - it
was calculating it as 10 * 8 * nboxes, which overflows when nboxes is
(eg) 56. The corrected calculation should be 10 + 8 * nboxes.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
When the X server unrealises a glyph, we weren't removing it from the
glyph cache. This results in a stale pointer in the cache to the glyph
which then is dereferenced when looking for a glyph to evict, leading
eventually to a segfault.
Fix this by removing the glyph from the cache while it's being
unrealised.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
We need to ensure that a drawable has monotonic MSC values irrespective
of what happens to the drawable - this includes when a drawable is
dragged between different CRTCs. Arrange to handle this, by noticing
that the CRTC has changed, and adapt the MSC value accordingly. We
also need to handle this when setting an event against the current
CRTC.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Move the handling of an undisplayed drawable into common_drm_get_msc()
where we can (eventually) be better at handling this situation. For
now, just move the code.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Pass the drawable into the common_drm MSC functions, so we can better
calculate a monotonic MSC value for each drawable.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
The MSC handling was taken from the xf86-video-intel driver, but it
seems to be lacking in that the wrap-handling is substandard; it can
result in DRI2 applications stalling for a very long time.
The problem is that xf86-video-intel is under the impression that the
vblank counter can wind backwards. This is not true; the kernel only
ever increments the counter (see functions that call store_vblank().)
Hence, remove this logic, and always assume that a vblank sequence
value that is less than a previously seen one means that it has
wrapped.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Drop support for DRI2 with galcore; we only support this using DRM
drivers and the etnaviv mesa-1 repository. This also allows us to use
"etnaviv" as the DRI2 module for Xorg to load, instead of "etnadrm" vs
"etnaviv". This aligns with the etnaviv mesa-1 repository.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
The comment above miComputeCompositeRegion() says:
/*
* returns FALSE if the final region is empty. Indistinguishable from
* an allocation failure, but rendering ignores those anyways.
*/
This is not true in at least Xorg 1.17 - it returns TRUE despite the
region being clipped away, and the final region being empty:
{extents = {x1 = 0, y1 = 0, x2 = 0, y2 = 0}, data = 0x1fda60 <RegionEmptyData>}
This appears to be due to the RegionIntersect() in miClipPictureSrc()
returning TRUE when RegionIntersect() determines that the region is
empty. The failing case is:
miComputeCompositeRegion(®ion, pSrc, 0, pDst, 0, 0, 0, 0, 0, 0, 1920, 1080)
where pSrc->clientClip is:
{extents = {x1 = -1000, y1 = -1000, x2 = -995, y2 = -995}, data = 0x0}
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Dennis Gilmore reports that Fedora sees assert()s from the etnaviv
backend when XFCE starts up. This is due to an incorrect calculation
in EL_START() which mistakenly multiplied the operation size by 4
(sizeof(uint32_t)) before adding it to the current batch buffer index.
This resulted in the calculated size overflowing the maximum batch
size, and causing the false assert().
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Don't error out when on missing libetnaviv functions when etnaviv
support is explicitly disabled. This allows building etnadrm
support with only the etnaviv source present.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Provide and use definitions for the workaround batch sizes, rather than
open-coding these constants.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Rather than using a hard-coded integer, use the calculated size of the
operation in etnaviv_de_op_src_origin() and etnaviv_de_op().
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Fix build error in src/common_drm.c caused by missing sys/stat.h
include:
common_drm.c:1002:14: error: storage size of 'st' isn't known
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
Signed-off-by: Russell King <rmk@arm.linux.org.uk> [edited commit message]
|
|
Add a bo cache pointer to the free method, so that if we embed the
bo_cache structure inside another structure, the free method can
access the parent structure.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add a typedef for the bo cache free method
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add an 8MB bo-cache, which helps when we allocate aligned 1080p buffers
via DRI.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Update to the latest DRM API, which adds an additional flags parameter
to the relocations.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add the missing piece of "adapt to changed fence/gem wait DRM UAPI" to
allow us to test for fence completion without hitting the slower kernel
paths.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Analysis shows that we can gain some additional performance by building
the GPU state buffer more efficiently - most of the overhead comes from
the assert() calls on each emission to the state buffer. Avoid this by
pre-checking and post-checking the state size, and doing as few of
these checks as possible.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add some further emit helpers to prepare to move to a more efficient
command stream generation scheme.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Fix the GPU driver selection, which would avoid trying the etnadrm
module if libetnaviv support was disabled.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Allow the etnadrm backend to work on both the old and new fence/gem
wait kernel interfaces.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
|
|
Clean up the flink support by moving flink into etnadrm.c, and
providing a stub implementation for the libetnaviv variant.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
The Vivante 3D resolve engine requires 16 pixel alignment for both the
width and height. Arrange for the DRI2 allocated buffers to meet this
requirement.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Ensure pixmap sizes are aligned according to the GPU accelerator
requirements. This allows modes such as 1366x768 to work with
Vivante GPUs.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add support for the Xorg platform bus DRM device discovery, which
allows DDX to work on systems that run the X server as a non-root user.
This adapts the KMS device only to this new model.
This is made more complex by bugs in the X server: the X server
proceeds to call the legacy probe method even after screens have been
discovered via the platformProbe method when the last device to be
probed fails (eg, due to the last device being a GPU device.)
We work around that by always opening the DRM device at probe time, and
issuing a SetVersion call, which causes subsequent probe attempts to
fail.
If we are running on a server which passes us the DRM device's file
descriptor, or a server running non-root, we must not attempt to drop
and regain the DRM master status ourselves; this will be managed for
us by the X server and other system components.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Record the last msc/ust values seen from the kernel for a CRTC, and use
them when requesting the current msc/ust for a CRTC which we're unable
to retrieve the current values for.
Since we're now able to report monotomic msc/ust values, there's no
need for common_drm_vblank_get() to warn when the kernel blocks the
call.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
When we've been switched away, the X server no longer owns the CRTC,
so reporting the CRTC which a pixmap is on is not appropriate.
Return NULL (indicating no CRTC) when we're switched away.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add DRI3 support to the etnadrm backend, defaulting to be disabled as
this has no capability to support flipping the scanout pixmap on split
KMS/render hardware. DRI2 is preferred for this.
A new option is added to allow DRI3 support to be enabled if DRI3
support is desired, in a manner similar to other DDX.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add initial support for the X present extension to the DDX driver.
This allows DRI3 clients to synchronise with the scanout hardware by
waiting for vblank events, and supports reading the current media
stamp counter and monotonic time values.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Convert DDX to use 64-bit MSC values thoughout the driver.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Prepare conversion to 64-bit MSC support.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Introduce a base drm event structure for all DRM events, which allows
us to abstract the event handling between each of the different events,
and localise the DRI2 event handling entirely within common_drm_dri2.c
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Move the guts of common_dri2_GetMSC() to common_drm_get_msc() to allow
this to be re-used for the present extension.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Move common_dri2_drawable_crtc() to common_drm.c, renaaming it to
common_drm_drawable_covering_crtc().
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
So they end up in the release tarball.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
If DRI2 is not enabled always skip the XVBO formats.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add etnadrm sub-package for etnadrm GPU module.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Lucas has changed the kernel API again, so update the etnadrm backend
to cope with these changes. We switch from a statically configured
API to a dynamically adapting implementation - we select the API to
be used based on the driver date code.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
The compiler complains about etnaviv->dri2_armada when DRI2 support
is disabled. Ensure that etnaviv_attach_name() is executed
conditionally.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[reworked patch and commit message -- rmk]
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
The X.Org server has fallback implementaion of strndup() whose prototype
gets pulled in by various X headers. This collides with the systems libc
strndup if this is provided.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|