lima: move clear into submit (v2)
authorQiang Yu <yuq825@gmail.com>
Wed, 5 Feb 2020 12:05:03 +0000 (20:05 +0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 Feb 2020 02:54:15 +0000 (02:54 +0000)
clear info is needed when submit flush and may be changed after
framebuffer switch, so we need to move it into submit.

This also fixes 5 dEQP tests as a side effect: clear info is per
submit so clear value when one submit won't affect next submit.

v2:
remove fixed dEQP test from CI list.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3755>

.gitlab-ci/deqp-lima-fails.txt
src/gallium/drivers/lima/lima_context.h
src/gallium/drivers/lima/lima_draw.c
src/gallium/drivers/lima/lima_submit.c
src/gallium/drivers/lima/lima_submit.h

index 2ddd3548250b6d71ec53eaa61c7bdfd72416999d..4ffb45331a7982b12c9f2600c6857ec7073b96ea 100644 (file)
@@ -26,11 +26,6 @@ dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgba_depth_co
 dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgba_stencil_index8
 dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgb_depth_component16
 dEQP-GLES2.functional.fbo.render.recreate_colorbuffer.rebind_tex2d_rgb_stencil_index8
-dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb565_stencil_index8
-dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgb5_a1_stencil_index8
-dEQP-GLES2.functional.fbo.render.shared_colorbuffer.rbo_rgba4_stencil_index8
-dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgba_stencil_index8
-dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_stencil_index8
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb565_depth_component16
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb5_a1_depth_component16
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgba4_depth_component16
index fa10b041df27fd9327d21ed59efc6c8c6e723618..53a0086fff1f110000e76e3bd353d8bbaeaab9a4 100644 (file)
@@ -38,14 +38,6 @@ struct lima_context_framebuffer {
    int shift_min;
 };
 
-struct lima_context_clear {
-   unsigned buffers;
-   uint32_t color_8pc;
-   uint32_t depth;
-   uint32_t stencil;
-   uint64_t color_16pc;
-};
-
 struct lima_depth_stencil_alpha_state {
    struct pipe_depth_stencil_alpha_state base;
 };
@@ -193,7 +185,6 @@ struct lima_context {
    struct lima_context_framebuffer framebuffer;
    struct lima_context_viewport_state viewport;
    struct pipe_scissor_state scissor;
-   struct lima_context_clear clear;
    struct lima_vs_shader_state *vs;
    struct lima_fs_shader_state *fs;
    struct lima_vertex_element_state *vertex_elements;
index 6e6d539e86778cb5c9a864ca3959e6a4bf654ffe..27728fe00a828e280ebc3947cb9201544b2a4cd7 100644 (file)
@@ -114,7 +114,7 @@ lima_clear(struct pipe_context *pctx, unsigned buffers,
    }
 
    struct lima_submit *submit = lima_submit_get(ctx);
-   struct lima_context_clear *clear = &ctx->clear;
+   struct lima_submit_clear *clear = &submit->clear;
    clear->buffers = buffers;
 
    if (buffers & PIPE_CLEAR_COLOR0) {
index e1c9643700665259bcf5106b604d3c989b024087..8b875566060c82e47ec81f8709cc3311d7eb6652 100644 (file)
@@ -740,12 +740,12 @@ lima_pack_pp_frame_reg(struct lima_submit *submit, uint32_t *frame_reg,
 
    frame->render_address = screen->pp_buffer->va + pp_frame_rsw_offset;
    frame->flags = 0x02;
-   frame->clear_value_depth = ctx->clear.depth;
-   frame->clear_value_stencil = ctx->clear.stencil;
-   frame->clear_value_color = ctx->clear.color_8pc;
-   frame->clear_value_color_1 = ctx->clear.color_8pc;
-   frame->clear_value_color_2 = ctx->clear.color_8pc;
-   frame->clear_value_color_3 = ctx->clear.color_8pc;
+   frame->clear_value_depth = submit->clear.depth;
+   frame->clear_value_stencil = submit->clear.stencil;
+   frame->clear_value_color = submit->clear.color_8pc;
+   frame->clear_value_color_1 = submit->clear.color_8pc;
+   frame->clear_value_color_2 = submit->clear.color_8pc;
+   frame->clear_value_color_3 = submit->clear.color_8pc;
    frame->one = 1;
 
    frame->width = fb->base.width - 1;
index 32b9637b3def42e833df815e653472cf164bdf0d..31d961a6d13ff6a15511bf45ef4ed66b75f5b3a7 100644 (file)
@@ -40,6 +40,14 @@ struct lima_submit_key {
    struct pipe_surface *zsbuf;
 };
 
+struct lima_submit_clear {
+   unsigned buffers;
+   uint32_t color_8pc;
+   uint32_t depth;
+   uint32_t stencil;
+   uint64_t color_16pc;
+};
+
 struct lima_submit {
    int fd;
    struct lima_context *ctx;
@@ -58,6 +66,8 @@ struct lima_submit {
    int pp_max_stack_size;
 
    struct pipe_scissor_state damage_rect;
+
+   struct lima_submit_clear clear;
 };
 
 struct lima_submit *lima_submit_get(struct lima_context *ctx);