Age | Commit message (Collapse) | Author |
|
The standard galcore user memory mapping function fails when asked to
map read-only memory, such as X shmem buffers. The reason these fail
is because get_user_pages() is always attempted with "write" mode
enabled, which is not permissible with read-only mappings.
To allow this to work (so that Xv can be implemented efficiently) we
must be able to map read-only buffers. This adds an extension to
etnaviv, found in my Dove galcore driver and Jon Nettleton's iMX6
kernels which permit this without changing the existing galcore APIs.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
dmabufs are DMA buffers which can be passed between kernel drivers
under the control of userspace by means of a file descriptor. Add
support to import dmabufs into etnaviv, creating an etna_bo for
them which can be released using the normal methods.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
The 4.6.9 iMX GCABI has a .physical member added to the MapUserMemory
structure, which must be initialised to ~0 to map by virtual address.
Introduce a new conditional "GCABI_MAPUSERMEMORY_HAS_PHYSICAL" to
indicate the presence of this member and arrange to initialise it
appropriately in viv_map_user_memory().
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add header files and etnaviv configuration for the 4.6.9 iMX galcore
version, found in (at least) Jon Nettleton's 3.14.14 kernel.
Signed-off-by: Jon Nettleton <jon.nettleton@gmail.com>
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Jon Nettleton's kernel galcore driver can return EINTR while waiting
for user signals. With this galcore version, if we are waiting on a
command buffer galcore signal (to indicate that the buffer is now
available for re-use), and we are sent a user signal (eg, SIGALRM),
then ioctl() may return EINTR.
This causes etnaviv to believe that the galcore signal was received,
and it is safe to proceed with the next command buffer. In reality,
this can cause the GPU to scribble over memory which it should not,
and can cause the entire platform to lock up.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Add a viv_ioctl() interface to provide an etnaviv version of
gcoOS_DeviceControl(). This allows us to temporarily extend galcore
with features that it otherwise would not have (such as my DMA buf
import, and support for user memory mapping of regions marked
read-only.)
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
etna_create() allocates six signals, one for the context and one per
allocated command buffer. etna_free() cleans up the command buffers,
but fails to clean up the signals which etna_create() allocated. Fix
this oversight.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
I don't know if this will have any effect but the check was clearly
the wrong way around.
Thanks to imirkin on IRC for noticing this.
|
|
We must ensure that the subdirectories are built in the correct
order, otherwise the link fails. Disable parallel make in the
top level makefile, so that only the lower level makefiles
benefit from parallel make.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
It is not very friendly for make -n to fail. Fix this.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Rather than printing command buffers as one word per line, print 8
words per line. This allows a more condensed view of the command
stream.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Avoid writing to stdout; depending on the program using etnaviv, stdout
may not be the console, and, in the case of programs such as Xorg, may
not be something which should receive any output.
As the C library uses stderr internally for assert(), it is reasonable
to expect that this will be suitable for debug output. Therefore,
direct etnaviv debugging output to stderr.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
Testing on Dove reveals that the context buffers are leaked each time
Etnaviv is closed down. This is caused by the ifdef which surrounds
the call to enta_bo_del() always being false, and so the code to free
this buffer is never compiled.
Fix the ifdef, and also fix the code so that it builds.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
|
|
|
|
|
|
Suggested by @kneo and @stefan-langenmaier at about the same time.
|
|
Revert behavior in case of one pixel pipe.
|
|
When detiling, the RS requires dimensions for the window
size that are a multiple of 4. With two pixel pipes this
amounts to 8.
Hence pad the height of the output buffers to the next multiple
of 8.
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
With this commit the PE pipe addresses and the
RS pipe addresses are the same --> on a GC2000
the image is combined correctly.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
We can detect via source and dest tiling if we need to use
multi pipes. So we can get rid of the extra tow mutli
variables in rs_state.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
excerpt from cmd buffer generated by binary blob:
0x08010581, /* LOAD_STATE (1) Base: 0x01604 Size: 1 Fixp: 0 */
0x20000686, /* [01604] RS.CONFIG := SOURCE_FORMAT=A8R8G8B8,DOWNSAMPLE_X=0,DOWNSAMPLE_Y=0,SOURCE_TILED=1,DEST_FORMAT=A8R8G8B8,DEST_TILED=0,SWAP_RB=1,FLIP=0 */
0x08010583, /* LOAD_STATE (1) Base: 0x0160C Size: 1 Fixp: 0 */
0xc0001c00, /* [0160C] RS.SOURCE_STRIDE := STRIDE=0x1c00,MULTI=1,TILING=1 */
0x08010585, /* LOAD_STATE (1) Base: 0x01614 Size: 1 Fixp: 0 */
0x00000700, /* [01614] RS.DEST_STRIDE := STRIDE=0x700,MULTI=0,TILING=0 */
0x0802058c, /* LOAD_STATE (1) Base: 0x01630 Size: 2 Fixp: 0 */
0xffffffff, /* [01630] RS.DITHER[0] := 0xffffffff */
0xffffffff, /* [01634] RS.DITHER[1] := 0xffffffff */
0x00000000, /* PAD */
0x0801058f, /* LOAD_STATE (1) Base: 0x0163C Size: 1 Fixp: 0 */
0x00000000, /* [0163C] RS.CLEAR_CONTROL := BITS=0x0,MODE=DISABLED */
0x080105a8, /* LOAD_STATE (1) Base: 0x016A0 Size: 1 Fixp: 0 */
0x00000000, /* [016A0] RS.EXTRA_CONFIG := AA=0x0,ENDIAN=NO_SWAP */
0x080205b0, /* LOAD_STATE (1) Base: 0x016C0 Size: 2 Fixp: 0 */
0x38910000, /* [016C0] RS.PIPE[0].SOURCE_ADDR := ADDR_I */
0x3894b000, /* [016C4] RS.PIPE[1].SOURCE_ADDR := ADDR_27 */
0x00000000, /* PAD */
0x080105b8, /* LOAD_STATE (1) Base: 0x016E0 Size: 1 Fixp: 0 */
0x38a37c00, /* [016E0] RS.PIPE[0].DEST_ADDR := ADDR_P */
0x08010588, /* LOAD_STATE (1) Base: 0x01620 Size: 1 Fixp: 0 */
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
this is what the binary blob does:
ADDR_I: 0x38910000 allocated: 0x73000 gcvSURF_RENDER_TARGET used for: TS.COLOR_SURFACE_BASE
PE.PIPE[0].COLOR_ADDR
ADDR_27:0x3894b000 used for: PE.PIPE[1].COLOR_ADDR
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
different values.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
|
|
|
|
gc2000 have minorFeatures4, document the register,
not that we know any of the bits yet...
|
|
small steps to get gc2000 up and running
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
|
|
gc2000: fix RS_PIPE_OFFSET and RS_WINDOW_SIZE
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
|
|
on a vivante gpu with only one pixel pipe the following gets used:
0x08010588, /* LOAD_STATE (1) Base: 0x01620 Size: 1 Fixp: 0 */
0x010001c0, /* [01620] RS.WINDOW_SIZE := HEIGHT=256,WIDTH=448 */
with two pixel pipes the following gets used:
0x008001c0, /* [01620] RS.WINDOW_SIZE := HEIGHT=128,WIDTH=448 */
0x080205c0, /* LOAD_STATE (1) Base: 0x01700 Size: 2 Fixp: 0 */
0x00000000, /* [01700] RS.PIPE[0].OFFSET := X=0,Y=0 */
0x00800000, /* [01704] RS.PIPE[1].OFFSET := X=0,Y=128 */
0x00000000, /* PAD */
|
|
|
|
GCABI_CONTEXT_HAS_PHYSICAL was still using the old ctx_info structure
which doesn't exist anymore.
|
|
Defaulting to v2 (or any version, at that) is a bad idea.
|