All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: dri-devel@lists.freedesktop.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: [PATCH 12/36] drm: omapdrm: Pass integer source coordinates to omap_plane_mode_set()
Date: Tue, 24 Mar 2015 14:15:29 +0200	[thread overview]
Message-ID: <1427199353-4412-13-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1427199353-4412-1-git-send-email-tomi.valkeinen@ti.com>

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The function will convert the Q16 source coordinates to integers, avoid
converting integers to Q16 first and perform the opposite conversion.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c  | 21 +++++++++------------
 drivers/gpu/drm/omapdrm/omap_drv.h   | 12 ++++++------
 drivers/gpu/drm/omapdrm/omap_plane.c | 24 ++++++++++++------------
 3 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 1ef3e0146c68..105eab7cb830 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -307,10 +307,9 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc,
 	crtc->primary->crtc = crtc;
 
 	return omap_plane_mode_set(crtc->primary, crtc, crtc->primary->fb,
-			0, 0, mode->hdisplay, mode->vdisplay,
-			x << 16, y << 16,
-			mode->hdisplay << 16, mode->vdisplay << 16,
-			NULL, NULL);
+				   0, 0, mode->hdisplay, mode->vdisplay,
+				   x, y, mode->hdisplay, mode->vdisplay,
+				   NULL, NULL);
 }
 
 static void omap_crtc_prepare(struct drm_crtc *crtc)
@@ -334,10 +333,9 @@ static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
 	struct drm_display_mode *mode = &crtc->mode;
 
 	return omap_plane_mode_set(plane, crtc, crtc->primary->fb,
-			0, 0, mode->hdisplay, mode->vdisplay,
-			x << 16, y << 16,
-			mode->hdisplay << 16, mode->vdisplay << 16,
-			NULL, NULL);
+				   0, 0, mode->hdisplay, mode->vdisplay,
+				   x, y, mode->hdisplay, mode->vdisplay,
+				   NULL, NULL);
 }
 
 static void vblank_cb(void *arg)
@@ -369,10 +367,9 @@ static void page_flip_worker(struct work_struct *work)
 
 	drm_modeset_lock(&crtc->mutex, NULL);
 	omap_plane_mode_set(crtc->primary, crtc, crtc->primary->fb,
-			0, 0, mode->hdisplay, mode->vdisplay,
-			crtc->x << 16, crtc->y << 16,
-			mode->hdisplay << 16, mode->vdisplay << 16,
-			vblank_cb, crtc);
+			    0, 0, mode->hdisplay, mode->vdisplay,
+			    crtc->x, crtc->y, mode->hdisplay, mode->vdisplay,
+			    vblank_cb, crtc);
 	drm_modeset_unlock(&crtc->mutex);
 
 	bo = omap_framebuffer_bo(crtc->primary->fb, 0);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 1805edc0107d..57e11c1f589f 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -163,12 +163,12 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
 		int id, enum drm_plane_type type);
 int omap_plane_set_enable(struct drm_plane *plane, bool enable);
 int omap_plane_mode_set(struct drm_plane *plane,
-		struct drm_crtc *crtc, struct drm_framebuffer *fb,
-		int crtc_x, int crtc_y,
-		unsigned int crtc_w, unsigned int crtc_h,
-		uint32_t src_x, uint32_t src_y,
-		uint32_t src_w, uint32_t src_h,
-		void (*fxn)(void *), void *arg);
+			struct drm_crtc *crtc, struct drm_framebuffer *fb,
+			int crtc_x, int crtc_y,
+			unsigned int crtc_w, unsigned int crtc_h,
+			unsigned int src_x, unsigned int src_y,
+			unsigned int src_w, unsigned int src_h,
+			void (*fxn)(void *), void *arg);
 void omap_plane_install_properties(struct drm_plane *plane,
 		struct drm_mode_object *obj);
 int omap_plane_set_property(struct drm_plane *plane,
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 309a2246b6e0..29f4371e9e00 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -184,12 +184,12 @@ static int omap_plane_apply(struct drm_plane *plane)
 }
 
 int omap_plane_mode_set(struct drm_plane *plane,
-		struct drm_crtc *crtc, struct drm_framebuffer *fb,
-		int crtc_x, int crtc_y,
-		unsigned int crtc_w, unsigned int crtc_h,
-		uint32_t src_x, uint32_t src_y,
-		uint32_t src_w, uint32_t src_h,
-		void (*fxn)(void *), void *arg)
+			struct drm_crtc *crtc, struct drm_framebuffer *fb,
+			int crtc_x, int crtc_y,
+			unsigned int crtc_w, unsigned int crtc_h,
+			unsigned int src_x, unsigned int src_y,
+			unsigned int src_w, unsigned int src_h,
+			void (*fxn)(void *), void *arg)
 {
 	struct omap_plane *omap_plane = to_omap_plane(plane);
 	struct omap_drm_window *win = &omap_plane->win;
@@ -199,11 +199,10 @@ int omap_plane_mode_set(struct drm_plane *plane,
 	win->crtc_w = crtc_w;
 	win->crtc_h = crtc_h;
 
-	/* src values are in Q16 fixed point, convert to integer: */
-	win->src_x = src_x >> 16;
-	win->src_y = src_y >> 16;
-	win->src_w = src_w >> 16;
-	win->src_h = src_h >> 16;
+	win->src_x = src_x;
+	win->src_y = src_y;
+	win->src_w = src_w;
+	win->src_h = src_h;
 
 	if (fxn) {
 		/* omap_crtc should ensure that a new page flip
@@ -243,9 +242,10 @@ static int omap_plane_update(struct drm_plane *plane,
 	plane->fb = fb;
 	plane->crtc = crtc;
 
+	/* src values are in Q16 fixed point, convert to integer: */
 	return omap_plane_mode_set(plane, crtc, fb,
 			crtc_x, crtc_y, crtc_w, crtc_h,
-			src_x, src_y, src_w, src_h,
+			src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
 			NULL, NULL);
 }
 
-- 
2.3.3

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

  parent reply	other threads:[~2015-03-24 12:16 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 12:15 [PATCH 00/36] drm/omap: patches for 4.1 Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 01/36] drm: omapdrm: Fix indentation of structure and array initializers Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 02/36] drm: omapdrm: Refactor CRTC creation code Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 03/36] drm: omapdrm: Remove unused variables Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 04/36] drm: omapdrm: Switch to the universal plane API Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 05/36] drm: omapdrm: Rename omap_plane_dpms() to omap_plane_set_enable() Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 06/36] drm: omapdrm: Reset the zorder property when disabling a plane Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 07/36] drm: omapdrm: Fix race condition between GO and vblank IRQ Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 08/36] drm: omapdrm: Remove manual update display support Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 09/36] drm: omapdrm: Remove omap_crtc->full_update field Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 10/36] drm: omapdrm: Avoid function forward declaration in omap_crtc.c Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 11/36] drm: omapdrm: Prefix all plane functions with omap_plane_ Tomi Valkeinen
2015-03-24 12:15 ` Tomi Valkeinen [this message]
2015-03-24 12:15 ` [PATCH 13/36] drm: omapdrm: Planes are already disabled when destroyed Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 14/36] drm: omapdrm: Reorder CRTC functions Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 15/36] drm/omap: fix encoder-crtc mapping Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 16/36] drm/omap: page_flip: return -EBUSY if flip pending Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 17/36] drm/omap: clear omap_obj->paddr in omap_gem_put_paddr() Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 18/36] drm/omap: add pin refcounting to omap_framebuffer Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 19/36] drm/omap: add a comment why locking is missing Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 20/36] drm/omap: fix operation without fbdev Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 21/36] drm/omap: fix error handling in omap_framebuffer_create() Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 22/36] drm/omap: handle incompatible buffer stride and pixel size Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 23/36] drm/omap: fix TILER on OMAP5 Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 24/36] drm/omap: fix plane's channel selection Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 25/36] drm/omap: tiler: fix race condition with engine->async Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 26/36] drm/omap: remove dummy PM functions Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 27/36] drm/omap: stop connector polling during suspend Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 28/36] drm/omap: use DRM_ERROR_RATELIMITED() for error irqs Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 29/36] drm/omap: fix race with error_irq Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 30/36] drm/omap: only ignore DIGIT SYNC LOST for TV output Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 31/36] drm/omap: do not use BUG_ON(!spin_is_locked(x)) Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 32/36] drm/omap: fix race condition with dev->obj_list Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 33/36] drm/omap: fix race conditon in DMM Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 34/36] drm/omap: keep ref to old_fb Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 35/36] drm/omap: add hibernation callbacks Tomi Valkeinen
2015-03-24 12:15 ` [PATCH 36/36] drm/omap: tiler: add hibernation callback Tomi Valkeinen

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=1427199353-4412-13-git-send-email-tomi.valkeinen@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    /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.