summaryrefslogtreecommitdiff
path: root/lib/intel_aux_pgtable.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2019-12-29 20:25:43 +0200
committerImre Deak <imre.deak@intel.com>2019-12-31 14:44:07 +0200
commit7ff35cc1d0b3896b72ac6b1b223d84383549f7b9 (patch)
treed1d9d290ce7f32eb228a71cbcead4f07434d3f9c /lib/intel_aux_pgtable.c
parent86d7c631bcc7b0f4e4683cb753ad2eafc170a7da (diff)
lib/igt_buf: Extend igt_buf to include two color surfaces
UV FBs have two color surfaces so extend the igt_buf struct accordingly to support blitting such FBs. The patch is produced with the coccinelle patch below. No functional changes. @@ @@ struct igt_buf { ... - uint32_t stride; ... - uint32_t size; + struct { + uint32_t stride; + uint32_t size; + } surface[2]; ... }; @@ struct igt_buf b; @@ <... ( - b.stride + b.surface[0].stride | - b.size + b.surface[0].size ) ...> @@ struct igt_buf *b; @@ <... ( - b->size + b->surface[0].size | - b->stride + b->surface[0].stride ) ...> @@ identifier I; expression E1; expression E2; @@ ( struct igt_buf I = { - .size = E1, - .stride = E2, + .surface[0] = { + .size = E1, + .stride = E2, + }, }; | struct igt_buf I = { - .size = E1, + .surface[0] = { + .size = E1, + }, }; | struct igt_buf I = { - .stride = E1, + .surface[0] = { + .stride = E1, + }, }; ) v2: - Rebase on latest upstream. (Mika) Cc: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'lib/intel_aux_pgtable.c')
-rw-r--r--lib/intel_aux_pgtable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/intel_aux_pgtable.c b/lib/intel_aux_pgtable.c
index dab83a9a..5addb2e2 100644
--- a/lib/intel_aux_pgtable.c
+++ b/lib/intel_aux_pgtable.c
@@ -77,7 +77,8 @@ pgt_table_count(int address_bits, const struct igt_buf **bufs, int buf_count)
/* Avoid double counting for overlapping aligned bufs. */
start = max(start, end);
- end = ALIGN(buf->bo->offset64 + buf->size, 1UL << address_bits);
+ end = ALIGN(buf->bo->offset64 + buf->surface[0].size,
+ 1UL << address_bits);
igt_assert(end >= start);
count += (end - start) >> address_bits;
@@ -255,7 +256,7 @@ pgt_populate_entries_for_buf(struct pgtable *pgt,
uint64_t top_table)
{
uint64_t surface_addr = buf->bo->offset64;
- uint64_t surface_end = surface_addr + buf->size;
+ uint64_t surface_end = surface_addr + buf->surface[0].size;
uint64_t aux_addr = buf->bo->offset64 + buf->ccs[0].offset;
uint64_t l1_flags = pgt_get_l1_flags(buf);
uint64_t lx_flags = pgt_get_lx_flags();