All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH 4/9] drm/i915: Avoid div-by-zero when computing aux_stride w/o an aux plane
Date: Wed,  4 Jan 2017 20:42:27 +0200	[thread overview]
Message-ID: <20170104184232.23048-5-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20170104184232.23048-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

To make life easier let's allow skl_plane_stride() to be called for the
AUX surface even when there is no AUX surface. Avoids special cases in
the callers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4d514ca1da88..bc398743e941 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3261,7 +3261,12 @@ static void skl_detach_scalers(struct intel_crtc *intel_crtc)
 u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,
 		     unsigned int rotation)
 {
-	u32 stride = intel_fb_pitch(fb, plane, rotation);
+	u32 stride;
+
+	if (plane >= fb->format->num_planes)
+		return 0;
+
+	stride = intel_fb_pitch(fb, plane, rotation);
 
 	/*
 	 * The stride is either expressed as a multiple of 64 bytes chunks for
-- 
2.10.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-01-04 18:42 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 18:42 [PATCH 0/9] drm/i915: SKL+ render decompression support ville.syrjala
2017-01-04 18:42 ` [PATCH 1/9] drm: Add mode_config .get_format_info() hook ville.syrjala
2017-01-05  3:15   ` Ben Widawsky
2017-01-05  8:48     ` Daniel Vetter
2017-01-04 18:42 ` [PATCH 2/9] drm/i915: Plumb drm_framebuffer into more places ville.syrjala
2017-02-02 13:30   ` [Intel-gfx] " Imre Deak
2017-01-04 18:42 ` [PATCH 3/9] drm/i915: Move nv12 chroma plane handling into intel_surf_alignment() ville.syrjala
2017-02-02 13:34   ` Imre Deak
2017-01-04 18:42 ` ville.syrjala [this message]
2017-02-02 13:38   ` [PATCH 4/9] drm/i915: Avoid div-by-zero when computing aux_stride w/o an aux plane Imre Deak
2017-01-04 18:42 ` [PATCH 5/9] drm/i915: Fix Yf tile width ville.syrjala
2017-02-02 15:07   ` Imre Deak
2017-01-04 18:42 ` [PATCH 6/9] drm/i915: Pass the correct plane index to _intel_compute_tile_offset() ville.syrjala
2017-02-02 16:10   ` Imre Deak
2017-01-04 18:42 ` [PATCH 7/9] drm/i915: Use DRM_DEBUG_KMS() for framebuffer failure debug messages ville.syrjala
2017-02-02 16:19   ` Imre Deak
2017-01-04 18:42 ` [PATCH 8/9] drm/i915: Implement .get_format_info() hook for CCS ville.syrjala
2017-01-05 16:24   ` Tvrtko Ursulin
2017-01-05 17:40     ` Ben Widawsky
2017-02-26 22:41   ` Chad Versace
2017-02-27 15:13     ` [Intel-gfx] " Ville Syrjälä
2017-02-28  5:36       ` Ben Widawsky
2017-01-04 18:42 ` [PATCH 9/9] drm/i915: Add render decompression support ville.syrjala
2017-01-04 19:14   ` Paulo Zanoni
2017-01-05 15:12     ` Ville Syrjälä
2017-01-05  4:25   ` Ben Widawsky
2017-01-05 15:11     ` Ville Syrjälä
2017-01-05 15:14   ` [PATCH v2 " ville.syrjala
2017-01-09 19:20     ` Jason Ekstrand
2017-01-10 17:04       ` Ville Syrjälä
2017-01-11 21:49         ` Jason Ekstrand
2017-01-11 22:29           ` Jason Ekstrand
2017-02-07 15:37     ` Imre Deak
2017-02-13 17:13       ` Ville Syrjälä
2017-02-28 20:18     ` Jason Ekstrand
2017-02-28 21:00       ` Ben Widawsky
2017-02-28 23:20       ` Ben Widawsky
2017-03-01 10:51         ` Ville Syrjälä
2017-03-01 17:50           ` Ben Widawsky
2017-03-01 18:00             ` Ville Syrjälä
2017-01-04 19:45 ` ✓ Fi.CI.BAT: success for drm/i915: SKL+ " Patchwork
2017-01-05 15:54 ` ✗ Fi.CI.BAT: failure for drm/i915: SKL+ render decompression support (rev2) Patchwork
2017-01-06 23:41 ` [PATCH 0/9] drm/i915: SKL+ render decompression support Ben Widawsky
2017-01-10 19:23 ` ✓ Fi.CI.BAT: success for drm/i915: SKL+ render decompression support (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170104184232.23048-5-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.