From: Alyssa Rosenzweig Date: Mon, 6 Apr 2020 23:45:30 +0000 (-0400) Subject: panfrost: Set clear_color_[12] in the extra fb desc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81a31911ddcf640d602ec104f7bbc3188dad3b7b;p=mesa.git panfrost: Set clear_color_[12] in the extra fb desc Signed-off-by: Alyssa Rosenzweig Signed-off-by: Tomeu Vizoso Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index c4063c317ea..562a05ff2df 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -161,6 +161,10 @@ panfrost_mfbd_clear( struct mali_render_target *rts, unsigned rt_count) { + struct panfrost_context *ctx = batch->ctx; + struct pipe_context *gallium = (struct pipe_context *) ctx; + struct panfrost_device *dev = pan_device(gallium->screen); + for (unsigned i = 0; i < rt_count; ++i) { if (!(batch->clear & (PIPE_CLEAR_COLOR0 << i))) continue; @@ -178,6 +182,11 @@ panfrost_mfbd_clear( if (batch->clear & PIPE_CLEAR_STENCIL) { fb->clear_stencil = batch->clear_stencil; } + + if (dev->quirks & IS_BIFROST) { + fbx->clear_color_1 = batch->clear_color[0][0]; + fbx->clear_color_2 = 0xc0000000 | (fbx->clear_color_1 & 0xffff); /* WTF? */ + } } static void diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index 6bf0b7caf1c..71beac01e6b 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -1670,7 +1670,9 @@ struct mali_framebuffer_extra { }; - u64 zero3, zero4; + u32 clear_color_1; + u32 clear_color_2; + u64 zero3; } __attribute__((packed)); /* Flags for mfbd_flags */ diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index 9d1afcfefc1..5e9c474e3d1 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -1274,10 +1274,14 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_comput pandecode_log("},\n"); } - if (fbx->zero3 || fbx->zero4) { + if (fbx->clear_color_1 | fbx->clear_color_2) { + pandecode_prop("clear_color_1 = 0x%" PRIx32, fbx->clear_color_1); + pandecode_prop("clear_color_2 = 0x%" PRIx32, fbx->clear_color_2); + } + + if (fbx->zero3) { pandecode_msg("XXX: fb_extra zeros tripped\n"); pandecode_prop("zero3 = 0x%" PRIx64, fbx->zero3); - pandecode_prop("zero4 = 0x%" PRIx64, fbx->zero4); } pandecode_indent--;