From 39811a2894743bf7e2f9818a0a1d14b6566116ee Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 28 Dec 2017 13:01:37 -0800 Subject: [PATCH] broadcom/vc5: Introduce enums for internal depth/type, with V3D prefixes. --- src/broadcom/cle/v3d_packet_v33.xml | 55 ++++++++++--------- src/gallium/drivers/vc5/vc5_draw.c | 18 +++--- src/gallium/drivers/vc5/vc5_formats.c | 76 +++++++++++++------------- src/gallium/drivers/vc5/vc5_rcl.c | 4 +- src/gallium/drivers/vc5/vc5_resource.c | 12 ++-- src/gallium/drivers/vc5/vc5_state.c | 4 +- 6 files changed, 85 insertions(+), 84 deletions(-) diff --git a/src/broadcom/cle/v3d_packet_v33.xml b/src/broadcom/cle/v3d_packet_v33.xml index 6049d7359b3..094ee00cf12 100644 --- a/src/broadcom/cle/v3d_packet_v33.xml +++ b/src/broadcom/cle/v3d_packet_v33.xml @@ -114,6 +114,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c index e07fbd8e810..d157531a178 100644 --- a/src/gallium/drivers/vc5/vc5_draw.c +++ b/src/gallium/drivers/vc5/vc5_draw.c @@ -524,7 +524,7 @@ vc5_clear(struct pipe_context *pctx, unsigned buffers, } switch (surf->internal_type) { - case INTERNAL_TYPE_8: + case V3D_INTERNAL_TYPE_8: if (surf->format == PIPE_FORMAT_B4G4R4A4_UNORM || surf->format == PIPE_FORMAT_B4G4R4A4_UNORM) { /* Our actual hardware layout is ABGR4444, but @@ -539,28 +539,28 @@ vc5_clear(struct pipe_context *pctx, unsigned buffers, } memcpy(job->clear_color[i], uc.ui, internal_size); break; - case INTERNAL_TYPE_8I: - case INTERNAL_TYPE_8UI: + case V3D_INTERNAL_TYPE_8I: + case V3D_INTERNAL_TYPE_8UI: job->clear_color[i][0] = ((uc.ui[0] & 0xff) | (uc.ui[1] & 0xff) << 8 | (uc.ui[2] & 0xff) << 16 | (uc.ui[3] & 0xff) << 24); break; - case INTERNAL_TYPE_16F: + case V3D_INTERNAL_TYPE_16F: util_pack_color(color->f, PIPE_FORMAT_R16G16B16A16_FLOAT, &uc); memcpy(job->clear_color[i], uc.ui, internal_size); break; - case INTERNAL_TYPE_16I: - case INTERNAL_TYPE_16UI: + case V3D_INTERNAL_TYPE_16I: + case V3D_INTERNAL_TYPE_16UI: job->clear_color[i][0] = ((uc.ui[0] & 0xffff) | uc.ui[1] << 16); job->clear_color[i][1] = ((uc.ui[2] & 0xffff) | uc.ui[3] << 16); break; - case INTERNAL_TYPE_32F: - case INTERNAL_TYPE_32I: - case INTERNAL_TYPE_32UI: + case V3D_INTERNAL_TYPE_32F: + case V3D_INTERNAL_TYPE_32I: + case V3D_INTERNAL_TYPE_32UI: memcpy(job->clear_color[i], color->ui, internal_size); break; } diff --git a/src/gallium/drivers/vc5/vc5_formats.c b/src/gallium/drivers/vc5/vc5_formats.c index b16ac1db3f8..432db913b42 100644 --- a/src/gallium/drivers/vc5/vc5_formats.c +++ b/src/gallium/drivers/vc5/vc5_formats.c @@ -309,22 +309,22 @@ vc5_get_internal_type_bpp_for_output_format(uint32_t format, case V3D_OUTPUT_IMAGE_FORMAT_ABGR4444: case V3D_OUTPUT_IMAGE_FORMAT_BGR565: case V3D_OUTPUT_IMAGE_FORMAT_ABGR1555: - *type = INTERNAL_TYPE_8; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_8; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA8I: case V3D_OUTPUT_IMAGE_FORMAT_RG8I: case V3D_OUTPUT_IMAGE_FORMAT_R8I: - *type = INTERNAL_TYPE_8I; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_8I; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA8UI: case V3D_OUTPUT_IMAGE_FORMAT_RG8UI: case V3D_OUTPUT_IMAGE_FORMAT_R8UI: - *type = INTERNAL_TYPE_8UI; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_8UI; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_SRGB8_ALPHA8: @@ -337,76 +337,76 @@ vc5_get_internal_type_bpp_for_output_format(uint32_t format, * and the conversion to sRGB happens at tilebuffer * load/store. */ - *type = INTERNAL_TYPE_16F; - *bpp = INTERNAL_BPP_64; + *type = V3D_INTERNAL_TYPE_16F; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_RG16F: case V3D_OUTPUT_IMAGE_FORMAT_R16F: - *type = INTERNAL_TYPE_16F; + *type = V3D_INTERNAL_TYPE_16F; /* Use 64bpp to make sure the TLB doesn't throw away the alpha * channel before alpha test happens. */ - *bpp = INTERNAL_BPP_64; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA16I: - *type = INTERNAL_TYPE_16I; - *bpp = INTERNAL_BPP_64; + *type = V3D_INTERNAL_TYPE_16I; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_RG16I: case V3D_OUTPUT_IMAGE_FORMAT_R16I: - *type = INTERNAL_TYPE_16I; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_16I; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA16UI: - *type = INTERNAL_TYPE_16UI; - *bpp = INTERNAL_BPP_64; + *type = V3D_INTERNAL_TYPE_16UI; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_RG16UI: case V3D_OUTPUT_IMAGE_FORMAT_R16UI: - *type = INTERNAL_TYPE_16UI; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_16UI; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA32I: - *type = INTERNAL_TYPE_32I; - *bpp = INTERNAL_BPP_128; + *type = V3D_INTERNAL_TYPE_32I; + *bpp = V3D_INTERNAL_BPP_128; break; case V3D_OUTPUT_IMAGE_FORMAT_RG32I: - *type = INTERNAL_TYPE_32I; - *bpp = INTERNAL_BPP_64; + *type = V3D_INTERNAL_TYPE_32I; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_R32I: - *type = INTERNAL_TYPE_32I; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_32I; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA32UI: - *type = INTERNAL_TYPE_32UI; - *bpp = INTERNAL_BPP_128; + *type = V3D_INTERNAL_TYPE_32UI; + *bpp = V3D_INTERNAL_BPP_128; break; case V3D_OUTPUT_IMAGE_FORMAT_RG32UI: - *type = INTERNAL_TYPE_32UI; - *bpp = INTERNAL_BPP_64; + *type = V3D_INTERNAL_TYPE_32UI; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_R32UI: - *type = INTERNAL_TYPE_32UI; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_32UI; + *bpp = V3D_INTERNAL_BPP_32; break; case V3D_OUTPUT_IMAGE_FORMAT_RGBA32F: - *type = INTERNAL_TYPE_32F; - *bpp = INTERNAL_BPP_128; + *type = V3D_INTERNAL_TYPE_32F; + *bpp = V3D_INTERNAL_BPP_128; break; case V3D_OUTPUT_IMAGE_FORMAT_RG32F: - *type = INTERNAL_TYPE_32F; - *bpp = INTERNAL_BPP_64; + *type = V3D_INTERNAL_TYPE_32F; + *bpp = V3D_INTERNAL_BPP_64; break; case V3D_OUTPUT_IMAGE_FORMAT_R32F: - *type = INTERNAL_TYPE_32F; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_32F; + *bpp = V3D_INTERNAL_BPP_32; break; default: @@ -414,8 +414,8 @@ vc5_get_internal_type_bpp_for_output_format(uint32_t format, * creation time, even if an RB with this format isn't * supported. */ - *type = INTERNAL_TYPE_8; - *bpp = INTERNAL_BPP_32; + *type = V3D_INTERNAL_TYPE_8; + *bpp = V3D_INTERNAL_BPP_32; break; } } diff --git a/src/gallium/drivers/vc5/vc5_rcl.c b/src/gallium/drivers/vc5/vc5_rcl.c index 600a8469668..f113d27961b 100644 --- a/src/gallium/drivers/vc5/vc5_rcl.c +++ b/src/gallium/drivers/vc5/vc5_rcl.c @@ -334,7 +334,7 @@ vc5_emit_rcl(struct vc5_job *job) clear.render_target_number = i; }; - if (surf->internal_bpp >= INTERNAL_BPP_64) { + if (surf->internal_bpp >= V3D_INTERNAL_BPP_64) { cl_emit(&job->rcl, TILE_RENDERING_MODE_CONFIGURATION_CLEAR_COLORS_PART2, clear) { clear.clear_color_mid_low_32_bits = @@ -347,7 +347,7 @@ vc5_emit_rcl(struct vc5_job *job) }; } - if (surf->internal_bpp >= INTERNAL_BPP_128 || clear_pad) { + if (surf->internal_bpp >= V3D_INTERNAL_BPP_128 || clear_pad) { cl_emit(&job->rcl, TILE_RENDERING_MODE_CONFIGURATION_CLEAR_COLORS_PART3, clear) { clear.uif_padded_height_in_uif_blocks = clear_pad; diff --git a/src/gallium/drivers/vc5/vc5_resource.c b/src/gallium/drivers/vc5/vc5_resource.c index dc768379ca4..ddf4d5d377a 100644 --- a/src/gallium/drivers/vc5/vc5_resource.c +++ b/src/gallium/drivers/vc5/vc5_resource.c @@ -443,13 +443,13 @@ vc5_resource_setup(struct pipe_screen *pscreen, &internal_type, &internal_bpp); switch (internal_bpp) { - case INTERNAL_BPP_32: + case V3D_INTERNAL_BPP_32: rsc->cpp = 4; break; - case INTERNAL_BPP_64: + case V3D_INTERNAL_BPP_64: rsc->cpp = 8; break; - case INTERNAL_BPP_128: + case V3D_INTERNAL_BPP_128: rsc->cpp = 16; break; } @@ -667,14 +667,14 @@ vc5_create_surface(struct pipe_context *pctx, if (util_format_is_depth_or_stencil(psurf->format)) { switch (psurf->format) { case PIPE_FORMAT_Z16_UNORM: - surface->internal_type = INTERNAL_TYPE_DEPTH_16; + surface->internal_type = V3D_INTERNAL_TYPE_DEPTH_16; break; case PIPE_FORMAT_Z32_FLOAT: case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: - surface->internal_type = INTERNAL_TYPE_DEPTH_32F; + surface->internal_type = V3D_INTERNAL_TYPE_DEPTH_32F; break; default: - surface->internal_type = INTERNAL_TYPE_DEPTH_24; + surface->internal_type = V3D_INTERNAL_TYPE_DEPTH_24; } } else { uint32_t bpp, type; diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c index a3ae2b3f539..35d5e1df509 100644 --- a/src/gallium/drivers/vc5/vc5_state.c +++ b/src/gallium/drivers/vc5/vc5_state.c @@ -617,10 +617,10 @@ vc5_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc, &internal_bpp); switch (internal_type) { - case INTERNAL_TYPE_8: + case V3D_INTERNAL_TYPE_8: tex.texture_type = TEXTURE_DATA_FORMAT_RGBA8; break; - case INTERNAL_TYPE_16F: + case V3D_INTERNAL_TYPE_16F: tex.texture_type = TEXTURE_DATA_FORMAT_RGBA16F; break; default: -- 2.30.2