diff options
author | Xianzhong <xianzhong.li@nxp.com> | 2017-12-17 07:31:09 +0800 |
---|---|---|
committer | Xianzhong <xianzhong.li@nxp.com> | 2017-12-17 19:45:44 +0800 |
commit | 39a267fd540365432918836522fbfbb71e2f7697 (patch) | |
tree | 6cc0a14991482873bb89e83ebf866aa7daaa377a | |
parent | dbad8e68bb51e63cc22ce5479d0016e579c34a45 (diff) |
MGS-3255: gpu-viv: implement command commit worker
i.MX8QM dual GPU SW workaround since no command sharing HW fix in B0,
optimized driver to improve GPU benchmark with better performance.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
3 files changed, 3 insertions, 93 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c index b20aaf5a60c2..1551da9f329d 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c +++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c @@ -2625,7 +2625,6 @@ gckCONTEXT_Update( gcsCONTEXT_PTR buffer; gcsSTATE_MAP_PTR map; gctBOOL needCopy = gcvFALSE; - gcsSTATE_DELTA_PTR nDelta; gcsSTATE_DELTA_PTR uDelta = gcvNULL; gcsSTATE_DELTA_PTR kDelta = gcvNULL; gcsSTATE_DELTA_RECORD_PTR record; @@ -2676,20 +2675,18 @@ gckCONTEXT_Update( = (gctUINT32)gcmPTR2INT32(Context); #endif - /* Are there any pending deltas? */ - if (buffer->deltaCount != 0) + if (StateDelta != gcvNULL) { /* Get the state map. */ map = Context->map; /* Get the first delta item. */ - uDelta = buffer->delta; + uDelta = StateDelta; /* Reset the vertex stream count. */ elementCount = 0; /* Merge all pending deltas. */ - for (i = 0; i < buffer->deltaCount; i += 1) { /* Get access to the state delta. */ gcmkONERROR(gckKERNEL_OpenUserData( @@ -2807,13 +2804,6 @@ gckCONTEXT_Update( elementCount = kDelta->elementCount; } - /* Dereference delta. */ - kDelta->refCount -= 1; - gcmkASSERT(kDelta->refCount >= 0); - - /* Get the next state delta. */ - nDelta = gcmUINT64_TO_PTR(kDelta->next); - if (dirtyRecordArraySize) { /* Get access to the state records. */ @@ -2834,9 +2824,6 @@ gckCONTEXT_Update( uDelta, gcmSIZEOF(gcsSTATE_DELTA), (gctPOINTER *) &kDelta )); - - /* Update the user delta pointer. */ - uDelta = nDelta; } /* Hardware disables all input attribute when the attribute 0 is programmed, @@ -2973,73 +2960,8 @@ gckCONTEXT_Update( nop += 2; } } - /* Reset pending deltas. */ - buffer->deltaCount = 0; - buffer->delta = gcvNULL; } - if (StateDelta) - { - /* Set state delta user pointer. */ - uDelta = StateDelta; - - /* Get access to the state delta. */ - gcmkONERROR(gckKERNEL_OpenUserData( - kernel, needCopy, - &_stateDelta, - uDelta, gcmSIZEOF(gcsSTATE_DELTA), - (gctPOINTER *) &kDelta - )); - - /* State delta cannot be attached to anything yet. */ - if (kDelta->refCount != 0) - { - gcmkTRACE( - gcvLEVEL_ERROR, - "%s(%d): kDelta->refCount = %d (has to be 0).\n", - __FUNCTION__, __LINE__, - kDelta->refCount - ); - } - - /* Attach to all contexts. */ - buffer = Context->buffer; - - do - { - /* Attach to the context if nothing is attached yet. If a delta - is allready attached, all we need to do is to increment - the number of deltas in the context. */ - if (buffer->delta == gcvNULL) - { - buffer->delta = uDelta; - } - - /* Update reference count. */ - kDelta->refCount += 1; - - /* Update counters. */ - buffer->deltaCount += 1; - - /* Get the next context buffer. */ - buffer = buffer->next; - - if (buffer == gcvNULL) - { - gcmkONERROR(gcvSTATUS_NOT_FOUND); - } - } - while (Context->buffer != buffer); - - /* Close access to the current state delta. */ - gcmkONERROR(gckKERNEL_CloseUserData( - kernel, needCopy, - gcvTRUE, - uDelta, gcmSIZEOF(gcsSTATE_DELTA), - (gctPOINTER *) &kDelta - )); - - } /* Schedule an event to mark the context buffer as available. */ gcmkONERROR(gckEVENT_Signal( buffer->eventObj, buffer->signal, gcvKERNEL_PIXEL diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h index 6a9092683d37..ea80365c21d5 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h +++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h @@ -100,12 +100,6 @@ typedef struct _gcsCONTEXT gctPOINTER link2D; gctPOINTER link3D; - /* The number of pending state deltas. */ - gctUINT deltaCount; - - /* Pointer to the first delta to be applied. */ - gcsSTATE_DELTA_PTR delta; - /* Next context buffer. */ gcsCONTEXT_PTR next; } diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h index 9e3c58a9dd5e..f22573d76cf9 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h +++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h @@ -112,9 +112,6 @@ typedef struct _gcsSTATE_DELTA the overflow.*/ gctUINT id; - /* The number of contexts pending modification by the delta. */ - gctINT refCount; - /* Vertex element count for the delta buffer. */ gctUINT elementCount; @@ -123,6 +120,7 @@ typedef struct _gcsSTATE_DELTA /* Record array; holds all modified states in gcsSTATE_DELTA_RECORD. */ gctUINT64 recordArray; + gctUINT recordSize; /* Map entry ID is used for map entry validation. If map entry ID does not match the main state delta ID, the entry and the corresponding state are @@ -133,10 +131,6 @@ typedef struct _gcsSTATE_DELTA /* If the map entry ID matches the main state delta ID, index points to the state record in the record array. */ gctUINT64 mapEntryIndex; - - /* Previous and next state deltas in gcsSTATE_DELTA. */ - gctUINT64 prev; - gctUINT64 next; } gcsSTATE_DELTA; |