summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-11-24etnaviv: masks with no RGB are not component alphaRussell King
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>
2016-11-24etnaviv: fix blending non-ARGB8888 destination formatsRussell King
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>
2016-11-23etnaviv: fix segfault in CloseScreenRussell King
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>
2016-11-22etnaviv: apply non-alpha workaround for reduced masksLucas Stach
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>
2016-11-22etnaviv: ensure the mask format is a valid source formatRussell King
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>
2016-11-22etnaviv: fix non-alpha mask composite operationsRussell King
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>
2016-11-22etnaviv: apply non-alpha workaround to temporary copy in acquire_srcLucas Stach
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>
2016-11-22etnaviv: take account of mask coordinates in renderRussell King
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>
2016-10-15Fix assert in etnaviv_vr_op()Russell King
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>
2016-09-19Fix segfault in glyph cacheRussell King
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>
2016-01-28src: dri2: fix MSC handling when a pixmap is moved between CRTCsRussell King
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>
2016-01-28src: dri2: move GetMSC() undisplayed drawable to common_drm_get_msc()Russell King
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>
2016-01-28src: dri2: pass drawable to MSC functionsRussell King
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>
2016-01-28src: dri2: fix MSC handlingRussell King
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>
2016-01-08etnaviv: only support etnaviv DRM for DRI2Russell King
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>
2016-01-07etnaviv: work around miComputeCompositeRegion()Russell King
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(&region, 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>
2016-01-07etnaviv: fix size calculation in EL_START()Russell King
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>
2016-01-06build: don't error out on missing etnaviv functionsRussell King
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>
2015-12-29build: add debian/xserver-xorg-video-armada-etnadrm to .gitignoreRussell King
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-12-29etnaviv: use definitions for workaround batch sizesRussell King
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>
2015-12-29etnaviv: clean up batch sizesRussell King
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>
2015-12-27src: add missing sys/stat.h importDennis Gilmore
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]
2015-12-24common: add bo cache pointer to free methodRussell King
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>
2015-12-24common: add bo cache free typedefRussell King
Add a typedef for the bo cache free method Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-12-24common: add 8M bo-cacheRussell King
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>
2015-12-17etnaviv: adapt to additional flags parameterLucas Stach
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>
2015-12-08etnaviv: add support for non-blocking fence queriesRussell King
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>
2015-12-02etnaviv: more efficient state buffer buildingRussell King
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>
2015-12-02etnaviv: add some further emit helpersRussell King
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>
2015-12-02src: fix GPU driver selectionRussell King
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>
2015-11-26etnaviv: adapt to changed fence/gem wait DRM UAPILucas Stach
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>
2015-11-24etnaviv: clean up flink supportRussell King
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>
2015-11-08etnaviv: align DRI2 buffers to 16 pixel width/heightRussell King
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>
2015-11-08src: ensure pixmaps are aligned to the GPU accelerator requirementsRussell King
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>
2015-11-08src: add support for Xorg platform bus and non-root serversRussell King
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>
2015-11-08src: record and use last seen msc/ust, quieten common_drm_vblank_get()Russell King
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>
2015-11-08src: common_drm_covering_crtc() returns NULL if !vtSemaRussell King
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>
2015-10-26etnaviv: add DRI3 supportRussell King
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>
2015-10-26src: initial present extension supportRussell King
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>
2015-10-26convert to 64-bit MSC valuesRussell King
Convert DDX to use 64-bit MSC values thoughout the driver. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-10-26src: prepare to convert to 64-bit mscRussell King
Prepare conversion to 64-bit MSC support. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-10-26src: introduce common DRM event handlingRussell King
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>
2015-10-26src: move guts of common_dri2_GetMSC() to common_drm_get_msc()Russell King
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>
2015-10-26src: move common_dri2_drawable_crtc()Russell King
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>
2015-10-26include headers in sources listsLucas Stach
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>
2015-10-26etnaviv: xv: fix build without DRI2Lucas Stach
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>
2015-10-24packaging: add etnadrm sub-packageRussell King
Add etnadrm sub-package for etnadrm GPU module. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-10-21etnaviv: update to work with later revision kernelspaceRussell King
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>
2015-09-15etnaviv: fix compilation without DRI2 supportLucas Stach
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>
2015-09-15make sure that system strndup doesn't collide with X.Org server versionLucas Stach
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>