freedreno/a5xx: move emit_marker5() into a5xx backend
The scratch registers move again in a6xx.. so for post-a4xx let's just move this into the backend, and move the one place it used to be needed in core into fd5_emit_ib(). For a6xx we will do similar, calling emit_marker6() from fd6_emit_ib(). Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
0c8d9e923a
commit
39b4fdc45f
|
@ -32,6 +32,7 @@
|
||||||
#include "freedreno_draw.h"
|
#include "freedreno_draw.h"
|
||||||
|
|
||||||
#include "fd5_context.h"
|
#include "fd5_context.h"
|
||||||
|
#include "fd5_screen.h"
|
||||||
|
|
||||||
/* some bits in common w/ a4xx: */
|
/* some bits in common w/ a4xx: */
|
||||||
#include "a4xx/fd4_draw.h"
|
#include "a4xx/fd4_draw.h"
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "fd5_program.h"
|
#include "fd5_program.h"
|
||||||
#include "fd5_rasterizer.h"
|
#include "fd5_rasterizer.h"
|
||||||
#include "fd5_texture.h"
|
#include "fd5_texture.h"
|
||||||
|
#include "fd5_screen.h"
|
||||||
#include "fd5_format.h"
|
#include "fd5_format.h"
|
||||||
#include "fd5_zsa.h"
|
#include "fd5_zsa.h"
|
||||||
|
|
||||||
|
@ -1101,7 +1102,15 @@ t7 opcode: CP_WAIT_FOR_IDLE (26) (1 dwords)
|
||||||
static void
|
static void
|
||||||
fd5_emit_ib(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
|
fd5_emit_ib(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
|
||||||
{
|
{
|
||||||
|
/* for debug after a lock up, write a unique counter value
|
||||||
|
* to scratch6 for each IB, to make it easier to match up
|
||||||
|
* register dumps to cmdstream. The combination of IB and
|
||||||
|
* DRAW (scratch7) is enough to "triangulate" the particular
|
||||||
|
* draw that caused lockup.
|
||||||
|
*/
|
||||||
|
emit_marker5(ring, 6);
|
||||||
__OUT_IB5(ring, target);
|
__OUT_IB5(ring, target);
|
||||||
|
emit_marker5(ring, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "fd5_context.h"
|
#include "fd5_context.h"
|
||||||
#include "fd5_format.h"
|
#include "fd5_format.h"
|
||||||
#include "fd5_program.h"
|
#include "fd5_program.h"
|
||||||
|
#include "fd5_screen.h"
|
||||||
#include "ir3_shader.h"
|
#include "ir3_shader.h"
|
||||||
|
|
||||||
struct fd_ringbuffer;
|
struct fd_ringbuffer;
|
||||||
|
|
|
@ -29,6 +29,19 @@
|
||||||
|
|
||||||
#include "pipe/p_screen.h"
|
#include "pipe/p_screen.h"
|
||||||
|
|
||||||
|
#include "freedreno_util.h"
|
||||||
|
|
||||||
|
#include "a5xx.xml.h"
|
||||||
|
|
||||||
void fd5_screen_init(struct pipe_screen *pscreen);
|
void fd5_screen_init(struct pipe_screen *pscreen);
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
emit_marker5(struct fd_ringbuffer *ring, int scratch_idx)
|
||||||
|
{
|
||||||
|
extern unsigned marker_cnt;
|
||||||
|
unsigned reg = REG_A5XX_CP_SCRATCH_REG(scratch_idx);
|
||||||
|
OUT_PKT4(ring, reg, 1);
|
||||||
|
OUT_RING(ring, ++marker_cnt);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* FD5_SCREEN_H_ */
|
#endif /* FD5_SCREEN_H_ */
|
||||||
|
|
|
@ -183,7 +183,6 @@ fd_half_precision(struct pipe_framebuffer_state *pfb)
|
||||||
#define LOG_DWORDS 0
|
#define LOG_DWORDS 0
|
||||||
|
|
||||||
static inline void emit_marker(struct fd_ringbuffer *ring, int scratch_idx);
|
static inline void emit_marker(struct fd_ringbuffer *ring, int scratch_idx);
|
||||||
static inline void emit_marker5(struct fd_ringbuffer *ring, int scratch_idx);
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
OUT_RING(struct fd_ringbuffer *ring, uint32_t data)
|
OUT_RING(struct fd_ringbuffer *ring, uint32_t data)
|
||||||
|
@ -372,14 +371,6 @@ __OUT_IB5(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
|
||||||
{
|
{
|
||||||
unsigned count = fd_ringbuffer_cmd_count(target);
|
unsigned count = fd_ringbuffer_cmd_count(target);
|
||||||
|
|
||||||
/* for debug after a lock up, write a unique counter value
|
|
||||||
* to scratch6 for each IB, to make it easier to match up
|
|
||||||
* register dumps to cmdstream. The combination of IB and
|
|
||||||
* DRAW (scratch7) is enough to "triangulate" the particular
|
|
||||||
* draw that caused lockup.
|
|
||||||
*/
|
|
||||||
emit_marker5(ring, 6);
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < count; i++) {
|
for (unsigned i = 0; i < count; i++) {
|
||||||
uint32_t dwords;
|
uint32_t dwords;
|
||||||
OUT_PKT7(ring, CP_INDIRECT_BUFFER, 3);
|
OUT_PKT7(ring, CP_INDIRECT_BUFFER, 3);
|
||||||
|
@ -387,8 +378,6 @@ __OUT_IB5(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
|
||||||
assert(dwords > 0);
|
assert(dwords > 0);
|
||||||
OUT_RING(ring, dwords);
|
OUT_RING(ring, dwords);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit_marker5(ring, 6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CP_SCRATCH_REG4 is used to hold base address for query results: */
|
/* CP_SCRATCH_REG4 is used to hold base address for query results: */
|
||||||
|
@ -409,16 +398,6 @@ emit_marker(struct fd_ringbuffer *ring, int scratch_idx)
|
||||||
OUT_RING(ring, ++marker_cnt);
|
OUT_RING(ring, ++marker_cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
emit_marker5(struct fd_ringbuffer *ring, int scratch_idx)
|
|
||||||
{
|
|
||||||
extern unsigned marker_cnt;
|
|
||||||
//XXX unsigned reg = REG_A5XX_CP_SCRATCH_REG(scratch_idx);
|
|
||||||
unsigned reg = 0x00000b78 + scratch_idx;
|
|
||||||
OUT_PKT4(ring, reg, 1);
|
|
||||||
OUT_RING(ring, ++marker_cnt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* helper to get numeric value from environment variable.. mostly
|
/* helper to get numeric value from environment variable.. mostly
|
||||||
* just leaving this here because it is helpful to brute-force figure
|
* just leaving this here because it is helpful to brute-force figure
|
||||||
* out unknown formats, etc, which blob driver does not support:
|
* out unknown formats, etc, which blob driver does not support:
|
||||||
|
|
Loading…
Reference in New Issue