sna/gen8: reduce CHV VS URB entries to 640
According to BSpec the max number of VS URB entries for CHV is 640. Based on a patch by Ville Syrjälä. v2: Start using a GT info block like earlier generations. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [v1] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
1e1a7875cf
commit
3abc3ce3b5
|
|
@ -205,6 +205,33 @@ static const struct blendinfo {
|
|||
#define OUT_VERTEX(x,y) vertex_emit_2s(sna, x,y)
|
||||
#define OUT_VERTEX_F(v) vertex_emit(sna, v)
|
||||
|
||||
struct gt_info {
|
||||
const char *name;
|
||||
struct {
|
||||
int max_vs_entries;
|
||||
} urb;
|
||||
};
|
||||
|
||||
static const struct gt_info bdw_gt_info = {
|
||||
.name = "Broadwell (gen8)",
|
||||
.urb = { .max_vs_entries = 960 },
|
||||
};
|
||||
|
||||
static bool is_bdw(struct sna *sna)
|
||||
{
|
||||
return sna->kgem.gen == 0100;
|
||||
}
|
||||
|
||||
static const struct gt_info chv_gt_info = {
|
||||
.name = "Cherryview (gen8)",
|
||||
.urb = { .max_vs_entries = 640 },
|
||||
};
|
||||
|
||||
static bool is_chv(struct sna *sna)
|
||||
{
|
||||
return sna->kgem.gen == 0101;
|
||||
}
|
||||
|
||||
static inline bool too_large(int width, int height)
|
||||
{
|
||||
return width > GEN8_MAX_SIZE || height > GEN8_MAX_SIZE;
|
||||
|
|
@ -462,7 +489,7 @@ gen8_emit_urb(struct sna *sna)
|
|||
{
|
||||
/* num of VS entries must be divisible by 8 if size < 9 */
|
||||
OUT_BATCH(GEN8_3DSTATE_URB_VS | (2 - 2));
|
||||
OUT_BATCH(960 << URB_ENTRY_NUMBER_SHIFT |
|
||||
OUT_BATCH(sna->render_state.gen8.info->urb.max_vs_entries << URB_ENTRY_NUMBER_SHIFT |
|
||||
(2 - 1) << URB_ENTRY_SIZE_SHIFT |
|
||||
4 << URB_STARTING_ADDRESS_SHIFT);
|
||||
|
||||
|
|
@ -3915,6 +3942,13 @@ static bool gen8_render_setup(struct sna *sna)
|
|||
state->gt = ((devid >> 4) & 0xf) + 1;
|
||||
DBG(("%s: gt=%d\n", __FUNCTION__, state->gt));
|
||||
|
||||
if (is_bdw(sna))
|
||||
state->info = &bdw_gt_info;
|
||||
else if (is_chv(sna))
|
||||
state->info = &chv_gt_info;
|
||||
else
|
||||
return false;
|
||||
|
||||
sna_static_stream_init(&general);
|
||||
|
||||
/* Zero pad the start. If you see an offset of 0x0 in the batchbuffer
|
||||
|
|
@ -4026,5 +4060,5 @@ const char *gen8_render_init(struct sna *sna, const char *backend)
|
|||
|
||||
sna->render.max_3d_size = GEN8_MAX_SIZE;
|
||||
sna->render.max_3d_pitch = 1 << 18;
|
||||
return "Broadwell";
|
||||
return sna->render_state.gen8.info->name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ enum {
|
|||
|
||||
struct gen8_render_state {
|
||||
unsigned gt;
|
||||
|
||||
const struct gt_info *info;
|
||||
struct kgem_bo *general_bo;
|
||||
|
||||
uint32_t vs_state;
|
||||
|
|
|
|||
Loading…
Reference in New Issue