#include "gen_eu_isa.xml.h"
#include "gen_eu_message.xml.h"
-#define GEN_MI_CMD(op) (GEN6_MI_TYPE_MI | GEN6_MI_OPCODE_ ## op)
-
-#define GEN_BLITTER_CMD(op) \
- (GEN6_BLITTER_TYPE_BLITTER | GEN6_BLITTER_OPCODE_ ## op)
-
-#define GEN_RENDER_CMD(subtype, op) \
- (GEN6_RENDER_TYPE_RENDER | \
- GEN6_RENDER_SUBTYPE_ ## subtype | \
- GEN6_RENDER_OPCODE_ ## op)
+#define GEN_MI_CMD(gen, op) (GEN6_MI_TYPE_MI | gen ## _MI_OPCODE_ ## op)
+#define GEN6_MI_CMD(op) GEN_MI_CMD(GEN6, op)
+#define GEN7_MI_CMD(op) GEN_MI_CMD(GEN7, op)
+
+#define GEN_BLITTER_CMD(gen, op) \
+ (GEN6_BLITTER_TYPE_BLITTER | gen ## _BLITTER_OPCODE_ ## op)
+#define GEN6_BLITTER_CMD(op) GEN_BLITTER_CMD(GEN6, op)
+
+#define GEN_RENDER_CMD(subtype, gen, op) \
+ (GEN6_RENDER_TYPE_RENDER | \
+ GEN6_RENDER_SUBTYPE_ ## subtype | \
+ gen ## _RENDER_OPCODE_ ## op)
+#define GEN6_RENDER_CMD(subtype, op) GEN_RENDER_CMD(subtype, GEN6, op)
+#define GEN7_RENDER_CMD(subtype, op) GEN_RENDER_CMD(subtype, GEN7, op)
+#define GEN75_RENDER_CMD(subtype, op) GEN_RENDER_CMD(subtype, GEN75, op)
static inline bool
gen_is_snb(int devid)
#include "ilo_resource.h"
#include "ilo_blitter.h"
-#define MI_FLUSH_DW GEN_MI_CMD(MI_FLUSH_DW)
-#define MI_LOAD_REGISTER_IMM GEN_MI_CMD(MI_LOAD_REGISTER_IMM)
-#define COLOR_BLT GEN_BLITTER_CMD(COLOR_BLT)
-#define XY_COLOR_BLT GEN_BLITTER_CMD(XY_COLOR_BLT)
-#define SRC_COPY_BLT GEN_BLITTER_CMD(SRC_COPY_BLT)
-#define XY_SRC_COPY_BLT GEN_BLITTER_CMD(XY_SRC_COPY_BLT)
-
enum gen6_blt_mask {
GEN6_BLT_MASK_8,
GEN6_BLT_MASK_16,
gen6_emit_MI_FLUSH_DW(struct ilo_dev_info *dev, struct ilo_cp *cp)
{
const uint8_t cmd_len = 4;
+ const uint32_t dw0 = GEN6_MI_CMD(MI_FLUSH_DW) | (cmd_len - 2);
ilo_cp_begin(cp, cmd_len);
- ilo_cp_write(cp, MI_FLUSH_DW | (cmd_len - 2));
+ ilo_cp_write(cp, dw0);
ilo_cp_write(cp, 0);
ilo_cp_write(cp, 0);
ilo_cp_write(cp, 0);
struct ilo_cp *cp)
{
const uint8_t cmd_len = 3;
+ const uint32_t dw0 = GEN6_MI_CMD(MI_LOAD_REGISTER_IMM) | (cmd_len - 2);
ilo_cp_begin(cp, cmd_len);
- ilo_cp_write(cp, MI_LOAD_REGISTER_IMM | (cmd_len - 2));
+ ilo_cp_write(cp, dw0);
ilo_cp_write(cp, reg);
ilo_cp_write(cp, val);
ilo_cp_end(cp);
const int cpp = gen6_translate_blt_cpp(value_mask);
uint32_t dw0, dw1;
- dw0 = COLOR_BLT |
+ dw0 = GEN6_BLITTER_CMD(COLOR_BLT) |
gen6_translate_blt_write_mask(write_mask) |
(cmd_len - 2);
int dst_align, dst_pitch_shift;
uint32_t dw0, dw1;
- dw0 = XY_COLOR_BLT |
+ dw0 = GEN6_BLITTER_CMD(XY_COLOR_BLT) |
gen6_translate_blt_write_mask(write_mask) |
(cmd_len - 2);
const int cpp = gen6_translate_blt_cpp(value_mask);
uint32_t dw0, dw1;
- dw0 = SRC_COPY_BLT |
+ dw0 = GEN6_BLITTER_CMD(SRC_COPY_BLT) |
gen6_translate_blt_write_mask(write_mask) |
(cmd_len - 2);
int src_align, src_pitch_shift;
uint32_t dw0, dw1;
- dw0 = XY_SRC_COPY_BLT |
+ dw0 = GEN6_BLITTER_CMD(XY_SRC_COPY_BLT) |
gen6_translate_blt_write_mask(write_mask) |
(cmd_len - 2);
#include "ilo_cp.h"
-#define MI_NOOP GEN_MI_CMD(MI_NOOP)
-#define MI_BATCH_BUFFER_END GEN_MI_CMD(MI_BATCH_BUFFER_END)
-
/* the size of the private space */
static const int ilo_cp_private = 2;
assert(cp->used + 2 <= cp->size);
- cp->ptr[cp->used++] = MI_BATCH_BUFFER_END;
+ cp->ptr[cp->used++] = GEN6_MI_CMD(MI_BATCH_BUFFER_END);
/*
* From the Sandy Bridge PRM, volume 1 part 1, page 107:
* length."
*/
if (cp->used & 1)
- cp->ptr[cp->used++] = MI_NOOP;
+ cp->ptr[cp->used++] = GEN6_MI_CMD(MI_NOOP);
}
/**
#define ILO_GPE_VALID_GEN(dev, min_gen, max_gen) \
assert((dev)->gen >= ILO_GEN(min_gen) && (dev)->gen <= ILO_GEN(max_gen))
-#define ILO_GPE_MI(op) (0x0 << 29 | (op) << 23)
-
-#define ILO_GPE_CMD(pipeline, op, subop) \
- (0x3 << 29 | (pipeline) << 27 | (op) << 24 | (subop) << 16)
-
/**
* Translate winsys tiling to hardware tiling.
*/
uint64_t val, bool store_qword,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_MI(0x20);
+ const uint32_t cmd = GEN6_MI_CMD(MI_STORE_DATA_IMM);
const uint8_t cmd_len = (store_qword) ? 5 : 4;
/* must use GGTT on GEN6 as in PIPE_CONTROL */
const uint32_t cmd_flags = (dev->gen == ILO_GEN(6)) ? (1 << 22) : 0;
uint32_t reg, uint32_t val,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_MI(0x22);
+ const uint32_t cmd = GEN6_MI_CMD(MI_LOAD_REGISTER_IMM);
const uint8_t cmd_len = 3;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
struct intel_bo *bo, uint32_t bo_offset,
uint32_t reg, struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_MI(0x24);
+ const uint32_t cmd = GEN6_MI_CMD(MI_STORE_REGISTER_MEM);
const uint8_t cmd_len = 3;
/* must use GGTT on GEN6 as in PIPE_CONTROL */
const uint32_t cmd_flags = (dev->gen == ILO_GEN(6)) ? (1 << 22) : 0;
struct intel_bo *bo, uint32_t bo_offset,
uint32_t report_id, struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_MI(0x28);
+ const uint32_t cmd = GEN6_MI_CMD(MI_REPORT_PERF_COUNT);
const uint8_t cmd_len = 3;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
uint32_t instruction_size,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x0, 0x1, 0x01);
+ const uint32_t cmd = GEN6_RENDER_CMD(COMMON, STATE_BASE_ADDRESS);
const uint8_t cmd_len = 10;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
uint32_t sip,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x0, 0x1, 0x02);
+ const uint32_t cmd = GEN6_RENDER_CMD(COMMON, STATE_SIP);
const uint8_t cmd_len = 2;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
bool enable,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x1, 0x0, 0x0b);
+ const uint32_t cmd = GEN6_RENDER_CMD(SINGLE_DW, 3DSTATE_VF_STATISTICS);
const uint8_t cmd_len = 1;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
int pipeline,
struct ilo_cp *cp)
{
- const int cmd = ILO_GPE_CMD(0x1, 0x1, 0x04);
+ const int cmd = GEN6_RENDER_CMD(SINGLE_DW, PIPELINE_SELECT);
const uint8_t cmd_len = 1;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
int urb_entry_size,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x2, 0x0, 0x00);
+ const uint32_t cmd = GEN6_RENDER_CMD(MEDIA, MEDIA_VFE_STATE);
const uint8_t cmd_len = 8;
uint32_t dw2, dw4;
uint32_t buf, int size,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x2, 0x0, 0x01);
+ const uint32_t cmd = GEN6_RENDER_CMD(MEDIA, MEDIA_CURBE_LOAD);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 6, 6);
uint32_t offset, int num_ids,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x2, 0x0, 0x02);
+ const uint32_t cmd =
+ GEN6_RENDER_CMD(MEDIA, MEDIA_INTERFACE_DESCRIPTOR_LOAD);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 6, 6);
int id, int byte, int thread_count,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x2, 0x0, 0x03);
+ const uint32_t cmd = GEN6_RENDER_CMD(MEDIA, MEDIA_GATEWAY_STATE);
const uint8_t cmd_len = 2;
uint32_t dw1;
int barrier_mask,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x2, 0x0, 0x04);
+ const uint32_t cmd = GEN6_RENDER_CMD(MEDIA, MEDIA_STATE_FLUSH);
const uint8_t cmd_len = 2;
uint32_t dw1;
uint32_t ps_binding_table,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x01);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_BINDING_TABLE_POINTERS);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 6, 6);
uint32_t ps_sampler_state,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x02);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLER_STATE_POINTERS);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 6, 6);
int vs_entry_size, int gs_entry_size,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x05);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_URB);
const uint8_t cmd_len = 3;
const int row_size = 128; /* 1024 bits */
int vs_alloc_size, gs_alloc_size;
const struct ilo_vb_state *vb,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x08);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_BUFFERS);
uint8_t cmd_len;
unsigned hw_idx;
bool prepend_generated_ids,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x09);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_ELEMENTS);
uint8_t cmd_len;
unsigned i;
bool enable_cut_index,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x0a);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_INDEX_BUFFER);
const uint8_t cmd_len = 3;
struct ilo_buffer *buf = ilo_buffer(ib->hw_resource);
uint32_t start_offset, end_offset;
uint32_t cc_viewport,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x0d);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_VIEWPORT_STATE_POINTERS);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 6, 6);
uint32_t color_calc_state,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x0e);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_CC_STATE_POINTERS);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 6, 6);
uint32_t scissor_rect,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x0f);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_SCISSOR_STATE_POINTERS);
const uint8_t cmd_len = 2;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
int num_samplers,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x10);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_VS);
const uint8_t cmd_len = 6;
const struct ilo_shader_cso *cso;
uint32_t dw2, dw4, dw5;
int verts_per_prim,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x11);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_GS);
const uint8_t cmd_len = 7;
uint32_t dw1, dw2, dw4, dw5, dw6;
int num_viewports,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x12);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_CLIP);
const uint8_t cmd_len = 4;
uint32_t dw1, dw2, dw3;
const struct ilo_shader_state *fs,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x13);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_SF);
const uint8_t cmd_len = 20;
uint32_t payload_raster[6], payload_sbe[13];
uint32_t hiz_op,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x14);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_WM);
const uint8_t cmd_len = 9;
const int num_samples = 1;
const struct ilo_shader_cso *fs_cso;
int num_bufs,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x15);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_VS);
const uint8_t cmd_len = 5;
uint32_t buf_dw[4], buf_enabled;
int num_bufs,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x16);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_GS);
const uint8_t cmd_len = 5;
uint32_t buf_dw[4], buf_enabled;
int num_bufs,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x17);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_PS);
const uint8_t cmd_len = 5;
uint32_t buf_dw[4], buf_enabled;
unsigned sample_mask,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x18);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLE_MASK);
const uint8_t cmd_len = 2;
const unsigned valid_mask = 0xf;
unsigned width, unsigned height,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x00);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_DRAWING_RECTANGLE);
const uint8_t cmd_len = 4;
unsigned xmax = x + width - 1;
unsigned ymax = y + height - 1;
struct ilo_cp *cp)
{
const uint32_t cmd = (dev->gen >= ILO_GEN(7)) ?
- ILO_GPE_CMD(0x3, 0x0, 0x05) : ILO_GPE_CMD(0x3, 0x1, 0x05);
+ GEN7_RENDER_CMD(3D, 3DSTATE_DEPTH_BUFFER) :
+ GEN6_RENDER_CMD(3D, 3DSTATE_DEPTH_BUFFER);
const uint8_t cmd_len = 7;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
int x_offset, int y_offset,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x06);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_POLY_STIPPLE_OFFSET);
const uint8_t cmd_len = 2;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
const struct pipe_poly_stipple *pattern,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x07);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_POLY_STIPPLE_PATTERN);
const uint8_t cmd_len = 33;
int i;
unsigned pattern, unsigned factor,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x08);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_LINE_STIPPLE);
const uint8_t cmd_len = 3;
unsigned inverse;
gen6_emit_3DSTATE_AA_LINE_PARAMETERS(const struct ilo_dev_info *dev,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x0a);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_AA_LINE_PARAMETERS);
const uint8_t cmd_len = 3;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
bool load_vertex_count,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x0b);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_GS_SVB_INDEX);
const uint8_t cmd_len = 4;
uint32_t dw1;
bool pixel_location_center,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x0d);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_MULTISAMPLE);
const uint8_t cmd_len = (dev->gen >= ILO_GEN(7)) ? 4 : 3;
uint32_t dw1, dw2, dw3;
struct ilo_cp *cp)
{
const uint32_t cmd = (dev->gen >= ILO_GEN(7)) ?
- ILO_GPE_CMD(0x3, 0x0, 0x06) :
- ILO_GPE_CMD(0x3, 0x1, 0x0e);
+ GEN7_RENDER_CMD(3D, 3DSTATE_STENCIL_BUFFER) :
+ GEN6_RENDER_CMD(3D, 3DSTATE_STENCIL_BUFFER);
const uint8_t cmd_len = 3;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
struct ilo_cp *cp)
{
const uint32_t cmd = (dev->gen >= ILO_GEN(7)) ?
- ILO_GPE_CMD(0x3, 0x0, 0x07) :
- ILO_GPE_CMD(0x3, 0x1, 0x0f);
+ GEN7_RENDER_CMD(3D, 3DSTATE_HIER_DEPTH_BUFFER) :
+ GEN6_RENDER_CMD(3D, 3DSTATE_HIER_DEPTH_BUFFER);
const uint8_t cmd_len = 3;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
uint32_t clear_val,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x10);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_CLEAR_PARAMS);
const uint8_t cmd_len = 2;
ILO_GPE_VALID_GEN(dev, 6, 6);
bool write_qword,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x2, 0x00);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, PIPE_CONTROL);
const uint8_t cmd_len = (write_qword) ? 5 : 4;
ILO_GPE_VALID_GEN(dev, 6, 7.5);
bool rectlist,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x3, 0x00);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DPRIMITIVE);
const uint8_t cmd_len = 6;
const int prim = (rectlist) ?
GEN6_3DPRIM_RECTLIST : ilo_gpe_gen6_translate_pipe_prim(info->mode);
uint32_t clear_val,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x04);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_CLEAR_PARAMS);
const uint8_t cmd_len = 3;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
uint32_t cut_index,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x0c);
+ const uint32_t cmd = GEN75_RENDER_CMD(3D, 3DSTATE_VF);
const uint8_t cmd_len = 2;
ILO_GPE_VALID_GEN(dev, 7.5, 7.5);
int subop, uint32_t pointer,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, subop);
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
+ GEN6_RENDER_SUBTYPE_3D |
+ subop;
const uint8_t cmd_len = 2;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
uint32_t color_calc_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x0e, color_calc_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN6_RENDER_OPCODE_3DSTATE_CC_STATE_POINTERS, color_calc_state, cp);
}
static inline void
int num_samplers,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x11);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_GS);
const uint8_t cmd_len = 7;
const struct ilo_shader_cso *cso;
uint32_t dw2, dw4, dw5;
enum pipe_format zs_format,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x13);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_SF);
const uint8_t cmd_len = 7;
const int num_samples = 1;
uint32_t payload[6];
bool cc_may_kill, uint32_t hiz_op,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x14);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_WM);
const uint8_t cmd_len = 3;
const int num_samples = 1;
uint32_t dw1, dw2;
int num_bufs,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, subop);
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
+ GEN6_RENDER_SUBTYPE_3D |
+ subop;
const uint8_t cmd_len = 7;
uint32_t dw[6];
int total_read_length, i;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
/* VS, HS, DS, GS, and PS variants */
- assert(subop >= 0x15 && subop <= 0x1a && subop != 0x18);
+ assert(subop >= GEN6_RENDER_OPCODE_3DSTATE_CONSTANT_VS &&
+ subop <= GEN7_RENDER_OPCODE_3DSTATE_CONSTANT_DS &&
+ subop != GEN6_RENDER_OPCODE_3DSTATE_SAMPLE_MASK);
assert(num_bufs <= 4);
int num_bufs,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_constant(dev, 0x15, bufs, sizes, num_bufs, cp);
+ gen7_emit_3dstate_constant(dev, GEN6_RENDER_OPCODE_3DSTATE_CONSTANT_VS,
+ bufs, sizes, num_bufs, cp);
}
static inline void
int num_bufs,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_constant(dev, 0x16, bufs, sizes, num_bufs, cp);
+ gen7_emit_3dstate_constant(dev, GEN6_RENDER_OPCODE_3DSTATE_CONSTANT_GS,
+ bufs, sizes, num_bufs, cp);
}
static inline void
int num_bufs,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_constant(dev, 0x17, bufs, sizes, num_bufs, cp);
+ gen7_emit_3dstate_constant(dev, GEN6_RENDER_OPCODE_3DSTATE_CONSTANT_PS,
+ bufs, sizes, num_bufs, cp);
}
static inline void
int num_samples,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x18);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLE_MASK);
const uint8_t cmd_len = 2;
const unsigned valid_mask = ((1 << num_samples) - 1) | 0x1;
int num_bufs,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_constant(dev, 0x19, bufs, sizes, num_bufs, cp);
+ gen7_emit_3dstate_constant(dev, GEN7_RENDER_OPCODE_3DSTATE_CONSTANT_HS,
+ bufs, sizes, num_bufs, cp);
}
static inline void
int num_bufs,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_constant(dev, 0x1a, bufs, sizes, num_bufs, cp);
+ gen7_emit_3dstate_constant(dev, GEN7_RENDER_OPCODE_3DSTATE_CONSTANT_DS,
+ bufs, sizes, num_bufs, cp);
}
static inline void
int num_samplers,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1b);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_HS);
const uint8_t cmd_len = 7;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
gen7_emit_3DSTATE_TE(const struct ilo_dev_info *dev,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1c);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_TE);
const uint8_t cmd_len = 4;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
int num_samplers,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1d);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_DS);
const uint8_t cmd_len = 6;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
bool rasterizer_discard,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1e);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_STREAMOUT);
const uint8_t cmd_len = 3;
const bool enable = (buffer_mask != 0);
uint32_t dw1, dw2;
const struct ilo_shader_state *fs,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x1f);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_SBE);
const uint8_t cmd_len = 14;
uint32_t dw[13];
int num_samplers, bool dual_blend,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, 0x20);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_PS);
const uint8_t cmd_len = 8;
const struct ilo_shader_cso *cso;
uint32_t dw2, dw4, dw5;
uint32_t sf_clip_viewport,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x21, sf_clip_viewport, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP,
+ sf_clip_viewport, cp);
}
static inline void
uint32_t cc_viewport,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x23, cc_viewport, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_VIEWPORT_STATE_POINTERS_CC,
+ cc_viewport, cp);
}
static inline void
uint32_t blend_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x24, blend_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_BLEND_STATE_POINTERS,
+ blend_state, cp);
}
static inline void
uint32_t depth_stencil_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x25, depth_stencil_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_DEPTH_STENCIL_STATE_POINTERS,
+ depth_stencil_state, cp);
}
static inline void
uint32_t binding_table,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x26, binding_table, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_BINDING_TABLE_POINTERS_VS,
+ binding_table, cp);
}
static inline void
uint32_t binding_table,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x27, binding_table, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_BINDING_TABLE_POINTERS_HS,
+ binding_table, cp);
}
static inline void
uint32_t binding_table,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x28, binding_table, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_BINDING_TABLE_POINTERS_DS,
+ binding_table, cp);
}
static inline void
uint32_t binding_table,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x29, binding_table, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_BINDING_TABLE_POINTERS_GS,
+ binding_table, cp);
}
static inline void
uint32_t binding_table,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x2a, binding_table, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_BINDING_TABLE_POINTERS_PS,
+ binding_table, cp);
}
static inline void
uint32_t sampler_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x2b, sampler_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_SAMPLER_STATE_POINTERS_VS,
+ sampler_state, cp);
}
static inline void
uint32_t sampler_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x2c, sampler_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_SAMPLER_STATE_POINTERS_HS,
+ sampler_state, cp);
}
static inline void
uint32_t sampler_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x2d, sampler_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_SAMPLER_STATE_POINTERS_DS,
+ sampler_state, cp);
}
static inline void
uint32_t sampler_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x2e, sampler_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_SAMPLER_STATE_POINTERS_GS,
+ sampler_state, cp);
}
static inline void
uint32_t sampler_state,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_pointer(dev, 0x2f, sampler_state, cp);
+ gen7_emit_3dstate_pointer(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_SAMPLER_STATE_POINTERS_PS,
+ sampler_state, cp);
}
static inline void
int entry_size,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x0, subop);
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
+ GEN6_RENDER_SUBTYPE_3D |
+ subop;
const uint8_t cmd_len = 2;
const int row_size = 64; /* 512 bits */
int alloc_size, num_entries, min_entries, max_entries;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
/* VS, HS, DS, and GS variants */
- assert(subop >= 0x30 && subop <= 0x33);
+ assert(subop >= GEN7_RENDER_OPCODE_3DSTATE_URB_VS &&
+ subop <= GEN7_RENDER_OPCODE_3DSTATE_URB_GS);
/* in multiples of 8KB */
assert(offset % 8192 == 0);
* cause performance to decrease due to banking in the URB. Element
* sizes of 16 to 20 should be programmed with six 512-bit URB rows."
*/
- if (subop == 0x30 && alloc_size == 5)
+ if (subop == GEN7_RENDER_OPCODE_3DSTATE_URB_VS && alloc_size == 5)
alloc_size = 6;
/* in multiples of 8 */
num_entries = (size / row_size / alloc_size) & ~7;
switch (subop) {
- case 0x30: /* 3DSTATE_URB_VS */
+ case GEN7_RENDER_OPCODE_3DSTATE_URB_VS:
min_entries = 32;
switch (dev->gen) {
if (num_entries > max_entries)
num_entries = max_entries;
break;
- case 0x31: /* 3DSTATE_URB_HS */
+ case GEN7_RENDER_OPCODE_3DSTATE_URB_HS:
max_entries = (dev->gt == 2) ? 64 : 32;
if (num_entries > max_entries)
num_entries = max_entries;
break;
- case 0x32: /* 3DSTATE_URB_DS */
+ case GEN7_RENDER_OPCODE_3DSTATE_URB_DS:
if (num_entries)
assert(num_entries >= 138);
break;
- case 0x33: /* 3DSTATE_URB_GS */
+ case GEN7_RENDER_OPCODE_3DSTATE_URB_GS:
switch (dev->gen) {
case ILO_GEN(7.5):
max_entries = (dev->gt >= 2) ? 640 : 256;
int offset, int size, int entry_size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_urb(dev, 0x30, offset, size, entry_size, cp);
+ gen7_emit_3dstate_urb(dev, GEN7_RENDER_OPCODE_3DSTATE_URB_VS,
+ offset, size, entry_size, cp);
}
static inline void
int offset, int size, int entry_size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_urb(dev, 0x31, offset, size, entry_size, cp);
+ gen7_emit_3dstate_urb(dev, GEN7_RENDER_OPCODE_3DSTATE_URB_HS,
+ offset, size, entry_size, cp);
}
static inline void
int offset, int size, int entry_size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_urb(dev, 0x32, offset, size, entry_size, cp);
+ gen7_emit_3dstate_urb(dev, GEN7_RENDER_OPCODE_3DSTATE_URB_DS,
+ offset, size, entry_size, cp);
}
static inline void
int offset, int size, int entry_size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_urb(dev, 0x33, offset, size, entry_size, cp);
+ gen7_emit_3dstate_urb(dev, GEN7_RENDER_OPCODE_3DSTATE_URB_GS,
+ offset, size, entry_size, cp);
}
static inline void
int subop, int offset, int size,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, subop);
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
+ GEN6_RENDER_SUBTYPE_3D |
+ subop;
const uint8_t cmd_len = 2;
int end;
ILO_GPE_VALID_GEN(dev, 7, 7.5);
/* VS, HS, DS, GS, and PS variants */
- assert(subop >= 0x12 && subop <= 0x16);
+ assert(subop >= GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_VS &&
+ subop <= GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_PS);
/*
* From the Ivy Bridge PRM, volume 2 part 1, page 68:
int offset, int size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_push_constant_alloc(dev, 0x12, offset, size, cp);
+ gen7_emit_3dstate_push_constant_alloc(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_VS, offset, size, cp);
}
static inline void
int offset, int size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_push_constant_alloc(dev, 0x13, offset, size, cp);
+ gen7_emit_3dstate_push_constant_alloc(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_HS, offset, size, cp);
}
static inline void
int offset, int size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_push_constant_alloc(dev, 0x14, offset, size, cp);
+ gen7_emit_3dstate_push_constant_alloc(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_DS, offset, size, cp);
}
static inline void
int offset, int size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_push_constant_alloc(dev, 0x15, offset, size, cp);
+ gen7_emit_3dstate_push_constant_alloc(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_GS, offset, size, cp);
}
static inline void
int offset, int size,
struct ilo_cp *cp)
{
- gen7_emit_3dstate_push_constant_alloc(dev, 0x16, offset, size, cp);
+ gen7_emit_3dstate_push_constant_alloc(dev,
+ GEN7_RENDER_OPCODE_3DSTATE_PUSH_CONSTANT_ALLOC_PS, offset, size, cp);
}
static inline void
const struct pipe_stream_output_info *so_info,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x17);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_SO_DECL_LIST);
uint16_t cmd_len;
int buffer_selects, num_entries, i;
uint16_t so_decls[128];
const struct pipe_stream_output_target *so_target,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x1, 0x18);
+ const uint32_t cmd = GEN7_RENDER_CMD(3D, 3DSTATE_SO_BUFFER);
const uint8_t cmd_len = 4;
struct ilo_buffer *buf;
int end;
bool rectlist,
struct ilo_cp *cp)
{
- const uint32_t cmd = ILO_GPE_CMD(0x3, 0x3, 0x00);
+ const uint32_t cmd = GEN6_RENDER_CMD(3D, 3DPRIMITIVE);
const uint8_t cmd_len = 7;
const int prim = (rectlist) ?
GEN6_3DPRIM_RECTLIST : ilo_gpe_gen6_translate_pipe_prim(info->mode);