[Intel-gfx] [PATCH] drm/i915/display: Fix initial fb to use resource_size_t

Chris Wilson chris at chris-wilson.co.uk
Tue Jul 7 18:00:20 UTC 2020


Quoting Tvrtko Ursulin (2020-07-07 18:48:23)
> 
> On 07/07/2020 18:15, Chris Wilson wrote:
> > We lookup up the physical address of the inherited framebuffer, and
> > presume that is an offset into the stolen memory region. As we are
> > dealing with physical resources and their addresses, we need to use
> > resource_size_t and not assume everything fits within a plain u32 [based
> > on prior assumptions that we were simpling handling offsets into the
> > GGTT not physical memory].
> > 
> > We made the switch to using resource_size_t for stolen in commit
> > b7128ef125b4 ("drm/i915: prefer resource_size_t for everything stolen")
> > 
> > Reported-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > References: b7128ef125b4 ("drm/i915: prefer resource_size_t for everything stolen")
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > Cc: Matthew Auld <matthew.auld at intel.com>
> > ---
> >   drivers/gpu/drm/i915/display/intel_display.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index dff7c17f3d2b..6bfe3148f927 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -3409,7 +3409,8 @@ initial_plane_vma(struct drm_i915_private *i915,
> >   {
> >       struct drm_i915_gem_object *obj;
> >       struct i915_vma *vma;
> > -     u32 base, size;
> > +     resource_size_t base;
> > +     resource_size_t size;
> >   
> >       if (plane_config->size == 0)
> >               return NULL;
> > 
> 
> There is also:
> 
>         base = round_down(plane_config->base,
>                           I915_GTT_MIN_ALIGNMENT);
> 
> struct intel_initial_plane_config {
>          struct intel_framebuffer *fb;
>          struct i915_vma *vma;
>          unsigned int tiling;
>          int size;
>          u32 base;
>          u8 rotation;
> };
> 
> So not sure, just throwing it out there.

In for a penny, in for a pound.
-Chris


More information about the Intel-gfx mailing list