[Intel-gfx] [PATCH 3/7] drm/i915/fb: Factor out functions to remap contiguous FB obj pages
Matthew Auld
matthew.william.auld at gmail.com
Fri Oct 29 16:26:05 UTC 2021
On Tue, 26 Oct 2021 at 23:51, Imre Deak <imre.deak at intel.com> wrote:
>
> Factor out functions needed to map contiguous FB obj pages to a GTT/DPT
> VMA view in the next patch.
>
> No functional changes.
>
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_ggtt.c | 110 +++++++++++++++------------
> 1 file changed, 60 insertions(+), 50 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> index 57c97554393b9..a30366d4965b6 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> @@ -1387,6 +1387,25 @@ intel_rotate_pages(struct intel_rotation_info *rot_info,
> return ERR_PTR(ret);
> }
>
> +static struct scatterlist *
> +add_padding_pages(unsigned int count,
> + struct sg_table *st, struct scatterlist *sg)
> +{
> + st->nents++;
> +
> + /*
> + * The DE ignores the PTEs for the padding tiles, the sg entry
> + * here is just a convenience to indicate how many padding PTEs
> + * to insert at this spot.
> + */
> + sg_set_page(sg, NULL, count * 4096, 0);
s/4096/I915_GTT_PAGE_SIZE ?
> + sg_dma_address(sg) = 0;
I guess maybe a little bit scary, since that might be a valid address.
Using the vma->vm scratch might be annoying though, since it could be
a different type than the object, plus this is only the GGTT.
Looks fine I think,
Reviewed-by: Matthew Auld <matthew.auld at intel.com>
More information about the Intel-gfx
mailing list