All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/9] drm: Warn about negative sizes when calculating scale factor
Date: Tue, 26 Jul 2016 19:06:56 +0300	[thread overview]
Message-ID: <1469549224-1860-2-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1469549224-1860-1-git-send-email-ville.syrjala@linux.intel.com>

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

Passing negative width/hight to scale factor calculations is not
legal. Let's WARN if that happens.

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

diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index a8e2c8603945..512199b60728 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -100,7 +100,7 @@ static int drm_calc_scale(int src, int dst)
 {
 	int scale = 0;
 
-	if (src < 0 || dst < 0)
+	if (WARN_ON(src < 0 || dst < 0))
 		return -EINVAL;
 
 	if (dst == 0)
-- 
2.7.4

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

  reply	other threads:[~2016-07-26 16:06 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 16:06 [PATCH 0/9] drm: Store clipped coordinates in drm_plane_state ville.syrjala
2016-07-26 16:06 ` ville.syrjala [this message]
2016-07-26 16:24   ` [PATCH 1/9] drm: Warn about negative sizes when calculating scale factor Chris Wilson
2016-07-26 16:39     ` Ville Syrjälä
2016-07-29 20:41       ` [Intel-gfx] " Sean Paul
2016-07-26 16:06 ` [PATCH 2/9] drm: Store clipped src/dst coordinatee in drm_plane_state ville.syrjala
2016-08-01 15:10   ` Sean Paul
2016-07-26 16:06 ` [PATCH 3/9] drm/plane-helper: Add drm_plane_helper_check_state() ville.syrjala
2016-07-26 16:33   ` Chris Wilson
2016-07-26 16:42     ` Ville Syrjälä
2016-07-27  7:22       ` [Intel-gfx] " Daniel Vetter
2016-07-26 17:34   ` [PATCH v2 " ville.syrjala
2016-08-01 15:10     ` [Intel-gfx] " Sean Paul
2016-08-08  7:29     ` Daniel Kurtz
2016-08-08  7:44       ` [Intel-gfx] " Ville Syrjälä
2016-08-08  7:55   ` [PATCH v3 " ville.syrjala
2016-07-26 16:06 ` [PATCH 4/9] drm/i915: Use drm_plane_state.{src,dst,visible} ville.syrjala
2016-07-26 16:20   ` Chris Wilson
2016-08-01 15:10   ` [PATCH 4/9] drm/i915: Use drm_plane_state.{src, dst, visible} Sean Paul
2016-07-26 16:07 ` [PATCH 5/9] drm/i915: Use drm_plane_helper_check_state() ville.syrjala
2016-08-01 15:10   ` Sean Paul
     [not found] ` <1469549224-1860-1-git-send-email-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-07-26 16:07   ` [PATCH 6/9] drm/rockchip: Use drm_plane_state.{src,dst} ville.syrjala-VuQAYsv1563Yd54FQh9/CA
2016-07-27  1:08     ` Mark yao
2016-08-01 15:10     ` [Intel-gfx] [PATCH 6/9] drm/rockchip: Use drm_plane_state.{src, dst} Sean Paul
2016-07-26 16:07 ` [PATCH 7/9] drm/rockchip: Use drm_plane_helper_check_state() ville.syrjala
2016-07-27  1:09   ` Mark yao
2016-08-01 15:10   ` [Intel-gfx] " Sean Paul
2016-07-26 16:07 ` [PATCH 8/9] drm/mediatek: " ville.syrjala
2016-08-01 15:10   ` Sean Paul
2016-08-02  5:31   ` Bibby Hsieh
2016-08-02  5:45   ` CK Hu
2016-07-26 16:07 ` [PATCH 9/9] drm/simple_kms_helper: " ville.syrjala
2016-08-01 15:10   ` Sean Paul
2016-07-26 16:31 ` ✓ Ro.CI.BAT: success for drm: Store clipped coordinates in drm_plane_state Patchwork
2016-07-27  6:00 ` ✗ Ro.CI.BAT: failure for drm: Store clipped coordinates in drm_plane_state (rev2) Patchwork
2016-08-01 15:12 ` [PATCH 0/9] drm: Store clipped coordinates in drm_plane_state Sean Paul
2016-08-01 15:19   ` Ville Syrjälä
2016-08-02 13:24     ` Daniel Vetter
2016-08-08  8:24 ` ✗ Ro.CI.BAT: failure for drm: Store clipped coordinates in drm_plane_state (rev3) Patchwork
2016-08-08 10:03 ` ✗ Fi.CI.BAT: " 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=1469549224-1860-2-git-send-email-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.