Skip to content

Commit

Permalink
drm/i915: align the plane_vma to min_page_size of stolen mem
Browse files Browse the repository at this point in the history
Align the plane vma size to the stolem memory regions' min_page_size.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
cc: Matthew Auld <matthew.auld@intel.com>
cc: Chris P Wilson <chris.p.wilson@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220128185209.18077-3-ramalingam.c@intel.com
  • Loading branch information
Ramalingam C committed Feb 11, 2022
1 parent 88d23ed commit 165bbfb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/i915/display/intel_plane_initial.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ static struct i915_vma *
initial_plane_vma(struct drm_i915_private *i915,
struct intel_initial_plane_config *plane_config)
{
struct intel_memory_region *mem = i915->mm.stolen_region;
struct drm_i915_gem_object *obj;
struct i915_vma *vma;
u32 base, size;

if (plane_config->size == 0)
if (!mem || plane_config->size == 0)
return NULL;

base = round_down(plane_config->base,
I915_GTT_MIN_ALIGNMENT);
size = round_up(plane_config->base + plane_config->size,
I915_GTT_MIN_ALIGNMENT);
mem->min_page_size);
size -= base;

/*
Expand Down

0 comments on commit 165bbfb

Please sign in to comment.