All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/5] drm/i915: Avoid div-by-zero when computing aux_stride w/o an aux plane
Date: Tue,  7 Mar 2017 21:42:08 +0200	[thread overview]
Message-ID: <20170307194210.13400-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20170307194210.13400-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>
Reviewed-by: Imre Deak <imre.deak@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 f0da21327198..ffa1041e10b9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3218,7 +3218,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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-03-07 19:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 19:42 [PATCH 0/5] drm/i915: CCS prep stuff ville.syrjala
2017-03-07 19:42 ` [PATCH 1/5] drm/i915: Plumb drm_framebuffer into more places ville.syrjala
2017-03-07 19:42 ` [PATCH 2/5] drm/i915: Move nv12 chroma plane handling into intel_surf_alignment() ville.syrjala
2017-03-07 19:42 ` ville.syrjala [this message]
2017-03-07 19:42 ` [PATCH 4/5] drm/i915: Pass the correct plane index to _intel_compute_tile_offset() ville.syrjala
2017-03-07 19:42 ` [PATCH v2 5/5] drm/i915: Use DRM_DEBUG_KMS() for framebuffer failure debug messages ville.syrjala
2017-03-07 20:22 ` ✗ Fi.CI.BAT: warning for drm/i915: CCS prep stuff Patchwork
2017-03-07 20:43   ` Ville Syrjälä
2017-03-08 13:52 ` ✗ Fi.CI.BAT: failure " Patchwork
2017-03-08 14:08   ` Ville Syrjälä
2017-03-08 14:11     ` Chris Wilson
2017-03-08 14:51 ` [PATCH 0/5] " Ville Syrjälä

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=20170307194210.13400-4-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --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.