From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com ([192.55.52.115]:36536 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbdATPAW (ORCPT ); Fri, 20 Jan 2017 10:00:22 -0500 Date: Fri, 20 Jan 2017 17:00:14 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Ander Conselvan de Oliveira Cc: intel-gfx@lists.freedesktop.org, Sivakumar Thulasimani , Daniel Vetter , Jani Nikula , stable@vger.kernel.org Subject: Re: [PATCH 3/4] drm/i915: Fix calculation of rotated x and y offsets for planar formats Message-ID: <20170120150014.GF31595@intel.com> References: <1484922525-6131-1-git-send-email-ander.conselvan.de.oliveira@intel.com> <1484922525-6131-3-git-send-email-ander.conselvan.de.oliveira@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1484922525-6131-3-git-send-email-ander.conselvan.de.oliveira@intel.com> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Jan 20, 2017 at 04:28:44PM +0200, Ander Conselvan de Oliveira wrote: > Parameters tile_size, tile_width and tile_height were passed in the > wrong order to _intel_adjust_tile_offset() when calculating the rotated > offsets. > > This doesn't fix any user visible bug, since for packaged formats new > and old offset are the same and the rotated offsets are within a tile > before they are fed to _intel_adjust_tile_offset(). In that case, the > offsets are unchanged. That is not true for planar formats, but those > are currently not supported. > > Found by coverity. > > Fixes: 66a2d927cb0e ("drm/i915: Make intel_adjust_tile_offset() work for linear buffers") > Cc: Ville Syrj�l� > Cc: Sivakumar Thulasimani > Cc: Daniel Vetter > Cc: Jani Nikula > Cc: intel-gfx@lists.freedesktop.org > Cc: # v4.9+ > Signed-off-by: Ander Conselvan de Oliveira Reviewed-by: Ville Syrj�l� /me should really dig up whatever fb offset tests I had written earlier and try to finish then... > --- > drivers/gpu/drm/i915/intel_display.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index bddadd9..0759e8b 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -2578,8 +2578,9 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv, > * We only keep the x/y offsets, so push all of the > * gtt offset into the x/y offsets. > */ > - _intel_adjust_tile_offset(&x, &y, tile_size, > - tile_width, tile_height, pitch_tiles, > + _intel_adjust_tile_offset(&x, &y, > + tile_width, tile_height, > + tile_size, pitch_tiles, > gtt_offset_rotated * tile_size, 0); > > gtt_offset_rotated += rot_info->plane[i].width * rot_info->plane[i].height; > -- > 2.5.5 -- Ville Syrj�l� Intel OTC