summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-06-29etnaviv: drop the force argument from etnaviv_pict_formatRussell King
We never force a format with etnaviv_pict_format() now, so get rid of this redundant argument. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: start splitting renderRussell King
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: rename and expose etnaviv_blit_startRussell King
Rename etnaviv_blit_start() to etnaviv_batch_start(), and expose it for others. This will allow the render code to be moved out of etnaviv_accel.c. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: move batch building macros into etnaviv_op.cRussell King
Move the batch building macros into etnaviv_op.c, which is the only place they're used. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: kill unused free_time memberRussell King
free_time is only ever written to, so kill it. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: remove etnaviv_blit()Russell King
etnaviv_blit() is just a wrapper around etnaviv_de_op(). Use etnaviv_de_op() directly. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: move box splitting into etnaviv_de_op()Russell King
Move the draw box splitting into etnaviv_de_op(), rather than etnaviv_blit(). This allows us to calculate how many boxes we can fit into the remainder of the batch buffer. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: remove etnaviv_blit_end()Russell King
etnaviv_blit_end() is just a wrapper around etnaviv_de_end(). Use etnaviv_de_end() directly. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: avoid blit setup in etnaviv_accel_FillSpans() if no work to doRussell King
Sometimes, we clip away all the spans to be filled. In this case, it's pointless emitting the setup states and adding the bo to the batch list. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: get rid of gal_prepare_gpu()Russell King
Finally get rid of gal_prepare_gpu(), which has been needing to die for a while now. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnadrm: track last completed fence idRussell King
Arrange for etnadrm to track the last completed fence id, using it to decide whether the next command buffer needs a call into the kernel to check whether it has completed or not. This cuts down on some kernel calls. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnadrm: move etnadrm_pipe into etna_viv_conn structRussell King
Move the etnadrm_pipe member into our etna_viv_conn structure, rather than hacking around with the etna_viv viv_conn structure. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: provide etnaviv_drawable()Russell King
Provide a version of etnaviv_drawable_offset() which doesn't return the offsets. This is useful in a couple of places, and avoids us having to either supply a dummy offset argument, or open code this. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: prevent A8 destination unless GPU has 2D_A8_FORMAT capabilityRussell King
Prevent A8 destination formats if the GPU does not support this destination format. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: avoid allocating temporary pixmap unnecessarilyRussell King
Avoid allocating (and freeing) the temporary pixmap for composite operations unless we're going to use it. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: add source/destination format validationRussell King
Add source/destination format validation for standard X operations. This will allow us to add support for other formats where GPU capabilities allow. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: clean up usage of vTemp in etnaviv_accel_composite_masked()Russell King
We should be using vSrc, since that's what etnaviv_acquire_src() returned to us, even though it's the same as vTemp. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: add miCompositeSourceValidate() calls for composite accel opRussell King
Add the missing calls to miCompositeSourceValidate() for the accelerated Composite() operation. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29src: provide option to switch to GPU bo allocationRussell King
Provide an xorg.conf option to switch pixmap allocations off Armada DRM onto the GPU instead. This is useful for Dove, where we would otherwise always use the Armada DRM allocator, and it allows the performance of the two allocators to be compared. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: add xvbo supportRussell King
Add full xvbo support. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnadrm: add dmabuf export and global name importRussell King
Add support for exporting dmabufs from etnadrm, and importing global names into etnadrm. These are required to support Xvbo overlay display, and also Xvbo in the etnadrm backend. It is necessary to also add dummy functions for libetnaviv to avoid link or runtime unresolved symbol errors, but we need to be careful of clashing with libetnaviv's etna_bo_from_name(), which uses different "names". Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnadrm: add support for retrieving the bo sizeRussell King
Add support for retrieving the bo size from bos, including dmabuf and usermem bos. This is needed for Xvbo support. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29src: Xv: allow Xvbo name import to be overriddenRussell King
If we have a DRM-based GPU, the DRI2 system exports the GPU DRM device rather than the KMS DRM device, and so the Xvbo names will be specific to the GPU rather than the KMS. Therefore, we need a way to talk to our accelerator backend to convert the GPU name into something we can display. This adds a hook in the Xv code to allow this, updates the GPU drivers to return capabilities indicating what they support. Currently, the etnaviv/drm backend does not support Xvbo in any form. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29src: Xv: ensure we check for changes in Xvbo streamRussell King
If an Xvbo stream switches between passing Xvbo buffers and normal images, we should re-setup accordingly, rather than trying to parse a normal image buffer as an Xvbo buffer. Handle this situation. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29src: Xv: rename is_bmm member to is_xvboRussell King
is_xvbo better reflects the function of this struct member, now that the old bmm support is completely gone. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29src: Xv: remove old bmm buffer passing from armada DRM Xv backendRussell King
Remove the old (and non-functional) bmm buffer passing from the Armada DRM Xv backend. This is obsolete and unsupported. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29conf: provide a sample xorg.conf fileRussell King
Provide a sample xorg.conf file so that people know what is expected to make Xorg servers find the driver module. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29common,etnaviv: convert glyph assembly to use a BoxRecRussell King
Use a BoxRec for the destination rectangle for the glyph, so the etnaviv code doesn't have to manually convert to a BoxRec. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: convert FillRectTiled to use source origin de opRussell King
Convert the tiled rectangle fill to use the source origin de operation, thereby allow etnaviv_blit_srcdst() to be removed. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: convert glyph rendering code to use source origin de opRussell King
When glyphs are coming from the glyph cache, it's common for them to have the same source. Since the destination is constant, we can save the setup time for each glyph, and only compute the source origin and destination box. Convert the glyph rendering to this model. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: convert etnaviv_blit_srcdst() to use absolute source origin modeRussell King
etnaviv_blit_srcdst() is a single-box copy from a source origin point to a single box on the destination. It doesn't make sense to calculate a relative offset for the source, we might as well use absolute origin mode. Switch to absolute origin mode, and add a DE op helper for this operation. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: add support for multiple source origin modesRussell King
Add support for multiple source origin modes. When we setup the source bo, we support: * None - no source origin, absolute mode. * Relative - relative top-left corner of source. * Absolute - absolute top-left corner of source. We treat None and Absolute the same, since we need the additional word in the command stream for alignment anyway. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: convert etnaviv_set_*_bo() to take etnaviv_blit_bufRussell King
Convert etnaviv_set_source_bo() and etnaviv_set_dest_bo() to take a pointer to the etnaviv_blit_buf structure, rather than individual members of this struct. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: fix double-free caused by xrandr shadow handlingRussell King
Switching the output mode between reflected and normal causes the Xorg cached scratch pixmap to end up with etnaviv private data pointing at a freed etnaviv_pixmap. A subsequent use of the scratch pixmap then causes glibc to complain about a double-free. Fix this. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: delay freeing the userptr etna bo and memoryRussell King
Delay freeing the userptr etna bo and memory until we're about to block, rather than waiting for the glyph upload to complete. This should make glyph upload of multiple glyphs more efficient as we don't have to wait for each to complete before uploading the next one. The down-side is an increase in the memory used by the X server, as we have to keep this memory around until the block handler gets called. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: etnadrm: add support for GEM_WAIT ioctlRussell King
Add support for the new GEM_WAIT ioctl, which waits for the kernel to finish with the GEM object (all render complete, and has been retired). This is different from the WAIT_FENCE ioctl, which just waits for rendering to complete. This is an important distinction, as when a gem object is retired and freed, the kernel will invalidate the cache for this object, which effectively changes the data userspace sees. If userspace merely waits for rendering to complete, there is a race condition where a userptr BO can be free()d and re-used, and the kernel's invalidation then corrupts the malloc() free lists. This commit ensures that etna_bo_del() on a userptr BO will not return until the kernel has done with the BO. On kernels which do not support the GEM_WAIT ioctl, we presently ignore the error. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: fix repeat handling in etnaviv_acquire_src()Russell King
Fix the repeat handling in etnaviv_acquire_src() - we need to apply the transform before checking for repeat. In doing this, we can convert over to using picture_needs_repeat() instead of adjusting the repeat on the source, which is more efficient. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: move forcing of source into temp pixmap into etnaviv_acquire_src()Russell King
Move the forcing of the source into the temporary pixmap into etnaviv_acquire_src(), where we will be able to better decide how to handle that case. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: fallback to software to acquire src for unhandled casesRussell King
If the source pixmap does not have an etna bo associated with it, we should nevertheless try to obtain it in a format we can use, to save bouncing the destination pixmap back to the CPU. Rearrange the code in etnaviv_acquire_src() to handle this case. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: remove transformations at clip timeRussell King
Extensive analysis of Xorg, Intel SNA, and other code indicates that the source clips are not affected by the transformation matrix, only the drawable position on the backing pixmap needs to be included in the passed coordinates. Since we now let through all transformations, we must ensure that transformations we can't handle in hardware cause us to fallback. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: fix memory leak in etnaviv_accel_Glyphs()Russell King
We were not freeing the array of glyphs to be drawn. Add the missing free()s. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: fix CopyNtoN clip boxRussell King
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: add bo caching support to etnadrmRussell King
Add bo caching support to etnadrm. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29common: add bo caching supportRussell King
Add generic bo caching support to the common library. Bo caching allows us to efficiently re-use bos which we have already allocated. Bos are sorted into buckets, and free entries are time-limited in the cache (provided bo_cache_clean() is called.) Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29compat-list.h: add xorg_list_entry aliasRussell King
The xorg_list_entry alias was missing, add it. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: sanitise render debuggingRussell King
Clean up the render debugging, and in doing so, eliminate some of the arguments to the composite lower levels. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: remove unnecessary (duplicated) checkRussell King
In the source-only code, if we're using the temporary pixmap, it will have alpha, so etnaviv_workaround_nonalpha() will fail anyway. There's no need to check for vSrc != vTemp. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: adjust mask repeat checkRussell King
Use the actual size of the region we will be compositing for the mask repeat check, rather than the requested size. This avoids cases where the area could be clipped smaller than the requested size, resulting in no repeat being needed. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: fallback for etnaviv_accel_composite_masked()Russell King
We can gain some performance for cases we don't handle by performing the masked blend in software, but still having the final blend in hardware. Rearrange etnaviv_accel_composite_masked() so that we are able to setup what we need, and then for cases we don't handle, fall back to using a software blend instead. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
2015-06-29etnaviv: pass pointer to temporary pixmap into etnaviv_acquire_srcRussell King
Pass a pointer to the temporary pixmap pointer into etnaviv_acquire_src(), thereby avoiding dereferencing this pointer until we actually need to use it. Signed-off-by: Russell King <rmk@arm.linux.org.uk>