diff options
author | Eric Anholt <[email protected]> | 2017-12-28 13:01:37 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-01-03 14:25:23 -0800 |
commit | 39811a2894743bf7e2f9818a0a1d14b6566116ee (patch) | |
tree | 2aba5c8cd2d972ba925a95e92190bc0d38b23206 /src | |
parent | d3e8a4b96c80955e832981534b1f4c3856b6fdb4 (diff) |
broadcom/vc5: Introduce enums for internal depth/type, with V3D prefixes.
Diffstat (limited to 'src')
-rw-r--r-- | src/broadcom/cle/v3d_packet_v33.xml | 55 | ||||
-rw-r--r-- | src/gallium/drivers/vc5/vc5_draw.c | 18 | ||||
-rw-r--r-- | src/gallium/drivers/vc5/vc5_formats.c | 76 | ||||
-rw-r--r-- | src/gallium/drivers/vc5/vc5_rcl.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/vc5/vc5_resource.c | 12 | ||||
-rw-r--r-- | 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 @@ <value name="all samples" value="3"/> </enum> + <enum name="Internal Type" prefix="V3D_INTERNAL_TYPE"> + <value name="8i" value="0"/> + <value name="8ui" value="1"/> + <value name="8" value="2"/> + <value name="16i" value="4"/> + <value name="16ui" value="5"/> + <value name="16f" value="6"/> + <value name="32i" value="8"/> + <value name="32ui" value="9"/> + <value name="32f" value="10"/> + </enum> + + <enum name="Internal BPP" prefix="V3D_INTERNAL_BPP"> + <value name="32" value="0"/> + <value name="64" value="1"/> + <value name="128" value="2"/> + </enum> + + <enum name="Internal Depth Type" prefix="V3D_INTERNAL_TYPE"> + <value name="depth_32f" value="0"/> + <value name="depth_24" value="1"/> + <value name="depth_16" value="2"/> + </enum> + <enum name="Output Image Format" prefix="V3D_OUTPUT_IMAGE_FORMAT"> <!-- Formats appear with their channels named from the low bits to @@ -482,11 +506,7 @@ <field name="Double-buffer in non-ms mode" size="1" start="63" type="bool"/> <field name="Multisample Mode (4x)" size="1" start="62" type="bool"/> - <field name="Maximum BPP of all render targets" size="2" start="60" type="uint"> - <value name="Render target maximum 32bpp" value="0"/> - <value name="Render target maximum 64bpp" value="1"/> - <value name="Render target maximum 128bpp" value="2"/> - </field> + <field name="Maximum BPP of all render targets" size="2" start="60" type="Internal BPP"/> <field name="Number of Render Targets" size="4" start="56" type="uint"/> <field name="Height (in tiles)" size="12" start="44" type="uint"/> @@ -560,23 +580,8 @@ <field name="Decimate mode" size="2" start="14" type="Decimate Mode"/> - <field name="Internal Type" size="4" start="10" type="uint" prefix="Internal Type"> - <value name="8i" value="0"/> - <value name="8ui" value="1"/> - <value name="8" value="2"/> - <value name="16i" value="4"/> - <value name="16ui" value="5"/> - <value name="16f" value="6"/> - <value name="32i" value="8"/> - <value name="32ui" value="9"/> - <value name="32f" value="10"/> - </field> - - <field name="Internal BPP" size="2" start="8" type="uint" prefix="Internal Bpp"> - <value name="32" value="0"/> - <value name="64" value="1"/> - <value name="128" value="2"/> - </field> + <field name="Internal Type" size="4" start="10" type="Internal Type"/> + <field name="Internal BPP" size="2" start="8" type="Internal BPP"/> <field name="Render Target Number" size="4" start="4" type="uint"/> <field name="sub-id" size="4" start="0" type="uint" default="2"/> </packet> @@ -592,11 +597,7 @@ <field name="Decimate mode" size="2" start="14" type="uint"/> - <field name="Internal Type" size="4" start="10" type="uint" prefix="Internal Type"> - <value name="depth_32f" value="0"/> - <value name="depth_24" value="1"/> - <value name="depth_16" value="2"/> - </field> + <field name="Internal Type" size="4" start="10" type="Internal Depth Type"/> <field name="Internal BPP (ignored)" size="2" start="8" type="uint"/> <!-- selects between Z/Stencil config packet and Separate Stencil packet. --> 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: |