[Intel-gfx] [PATCH 04/23] drm/i915: Make sure i915_ggtt_view is inited when creating an FB

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Mar 11 16:07:47 UTC 2021


On Thu, Mar 11, 2021 at 12:17:17AM +0200, Imre Deak wrote:
> This probably doesn't cause an issue, since the code checks the view
> type dependent size of the views before comparing them, but let's follow
> the practice to bzero the whole struct when initializing it.
> 
> Signed-off-by: Imre Deak <imre.deak at intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 12b54e032bc1..7bc541b75eef 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1003,6 +1003,8 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view,
>  			const struct drm_framebuffer *fb,
>  			unsigned int rotation)
>  {
> +	memset(view, 0, sizeof(*view));
> +
>  	view->type = I915_GGTT_VIEW_NORMAL;
>  	if (drm_rotation_90_or_270(rotation)) {
>  		view->type = I915_GGTT_VIEW_ROTATED;
> -- 
> 2.25.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list