mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
broadcom/vc5: Move V3D 3.3 VPM write setup to a separate file.
For V4.1 texturing, I need the V4.1 XML, so the main compiler needs to stop including V3.3 XML.
This commit is contained in:
parent
725d73981a
commit
acf30e4916
5 changed files with 82 additions and 34 deletions
|
|
@ -29,6 +29,7 @@ BROADCOM_FILES = \
|
|||
compiler/vir_to_qpu.c \
|
||||
compiler/qpu_schedule.c \
|
||||
compiler/qpu_validate.c \
|
||||
compiler/v3d33_vpm_setup.c \
|
||||
compiler/v3d_compiler.h \
|
||||
compiler/v3d_nir_lower_io.c \
|
||||
compiler/v3d_nir_lower_txf_ms.c \
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ libbroadcom_compiler_files = files(
|
|||
'vir_to_qpu.c',
|
||||
'qpu_schedule.c',
|
||||
'qpu_validate.c',
|
||||
'v3d33_vpm_setup.c',
|
||||
'v3d_compiler.h',
|
||||
'v3d_nir_lower_io.c',
|
||||
'v3d_nir_lower_txf_ms.c',
|
||||
|
|
|
|||
|
|
@ -1315,22 +1315,7 @@ emit_vpm_write_setup(struct v3d_compile *c)
|
|||
if (c->devinfo->ver >= 40)
|
||||
return;
|
||||
|
||||
uint32_t packed;
|
||||
struct V3D33_VPM_GENERIC_BLOCK_WRITE_SETUP unpacked = {
|
||||
V3D33_VPM_GENERIC_BLOCK_WRITE_SETUP_header,
|
||||
|
||||
.horiz = true,
|
||||
.laned = false,
|
||||
.segs = true,
|
||||
.stride = 1,
|
||||
.size = VPM_SETUP_SIZE_32_BIT,
|
||||
.addr = 0,
|
||||
};
|
||||
|
||||
V3D33_VPM_GENERIC_BLOCK_WRITE_SETUP_pack(NULL,
|
||||
(uint8_t *)&packed,
|
||||
&unpacked);
|
||||
vir_VPMSETUP(c, vir_uniform_ui(c, packed));
|
||||
v3d33_vir_vpm_write_setup(c);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1443,24 +1428,7 @@ ntq_emit_vpm_read(struct v3d_compile *c,
|
|||
|
||||
uint32_t num_components = MIN2(*remaining, 32);
|
||||
|
||||
struct V3D33_VPM_GENERIC_BLOCK_READ_SETUP unpacked = {
|
||||
V3D33_VPM_GENERIC_BLOCK_READ_SETUP_header,
|
||||
|
||||
.horiz = true,
|
||||
.laned = false,
|
||||
/* If the field is 0, that means a read count of 32. */
|
||||
.num = num_components & 31,
|
||||
.segs = true,
|
||||
.stride = 1,
|
||||
.size = VPM_SETUP_SIZE_32_BIT,
|
||||
.addr = c->num_inputs,
|
||||
};
|
||||
|
||||
uint32_t packed;
|
||||
V3D33_VPM_GENERIC_BLOCK_READ_SETUP_pack(NULL,
|
||||
(uint8_t *)&packed,
|
||||
&unpacked);
|
||||
vir_VPMSETUP(c, vir_uniform_ui(c, packed));
|
||||
v3d33_vir_vpm_read_setup(c, num_components);
|
||||
|
||||
*num_components_queued = num_components - 1;
|
||||
*remaining -= num_components;
|
||||
|
|
|
|||
75
src/broadcom/compiler/v3d33_vpm_setup.c
Normal file
75
src/broadcom/compiler/v3d33_vpm_setup.c
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright © 2016-2018 Broadcom
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "v3d_compiler.h"
|
||||
|
||||
/* We don't do any address packing. */
|
||||
#define __gen_user_data void
|
||||
#define __gen_address_type uint32_t
|
||||
#define __gen_address_offset(reloc) (*reloc)
|
||||
#define __gen_emit_reloc(cl, reloc)
|
||||
#include "broadcom/cle/v3d_packet_v33_pack.h"
|
||||
|
||||
void
|
||||
v3d33_vir_vpm_read_setup(struct v3d_compile *c, int num_components)
|
||||
{
|
||||
struct V3D33_VPM_GENERIC_BLOCK_READ_SETUP unpacked = {
|
||||
V3D33_VPM_GENERIC_BLOCK_READ_SETUP_header,
|
||||
|
||||
.horiz = true,
|
||||
.laned = false,
|
||||
/* If the field is 0, that means a read count of 32. */
|
||||
.num = num_components & 31,
|
||||
.segs = true,
|
||||
.stride = 1,
|
||||
.size = VPM_SETUP_SIZE_32_BIT,
|
||||
.addr = c->num_inputs,
|
||||
};
|
||||
|
||||
uint32_t packed;
|
||||
V3D33_VPM_GENERIC_BLOCK_READ_SETUP_pack(NULL,
|
||||
(uint8_t *)&packed,
|
||||
&unpacked);
|
||||
vir_VPMSETUP(c, vir_uniform_ui(c, packed));
|
||||
}
|
||||
|
||||
void
|
||||
v3d33_vir_vpm_write_setup(struct v3d_compile *c)
|
||||
{
|
||||
uint32_t packed;
|
||||
struct V3D33_VPM_GENERIC_BLOCK_WRITE_SETUP unpacked = {
|
||||
V3D33_VPM_GENERIC_BLOCK_WRITE_SETUP_header,
|
||||
|
||||
.horiz = true,
|
||||
.laned = false,
|
||||
.segs = true,
|
||||
.stride = 1,
|
||||
.size = VPM_SETUP_SIZE_32_BIT,
|
||||
.addr = 0,
|
||||
};
|
||||
|
||||
V3D33_VPM_GENERIC_BLOCK_WRITE_SETUP_pack(NULL,
|
||||
(uint8_t *)&packed,
|
||||
&unpacked);
|
||||
vir_VPMSETUP(c, vir_uniform_ui(c, packed));
|
||||
}
|
||||
|
|
@ -684,6 +684,9 @@ void v3d_nir_lower_io(nir_shader *s, struct v3d_compile *c);
|
|||
void v3d_nir_lower_txf_ms(nir_shader *s, struct v3d_compile *c);
|
||||
void vir_lower_uniforms(struct v3d_compile *c);
|
||||
|
||||
void v3d33_vir_vpm_read_setup(struct v3d_compile *c, int num_components);
|
||||
void v3d33_vir_vpm_write_setup(struct v3d_compile *c);
|
||||
|
||||
void v3d_vir_to_qpu(struct v3d_compile *c, struct qpu_reg *temp_registers);
|
||||
uint32_t v3d_qpu_schedule_instructions(struct v3d_compile *c);
|
||||
void qpu_validate(struct v3d_compile *c);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue