From: Stefan Agner <stefan@agner.ch>
To: dri-devel@lists.freedesktop.org, meng.yi@nxp.com
Cc: alison.wang@freescale.com, jianwei.wang.chn@gmail.com,
linux-kernel@vger.kernel.org, Stefan Agner <stefan@agner.ch>
Subject: [PATCH 2/4] drm/fsl-dcu: respect pos/size register sizes
Date: Mon, 5 Sep 2016 21:02:31 -0700 [thread overview]
Message-ID: <20160906040233.32471-3-stefan@agner.ch> (raw)
In-Reply-To: <20160906040233.32471-1-stefan@agner.ch>
Mask the size and position values to avoid mutual overwriting.
Especially, a negative X position caused the Y position to be
overwritten with 0xfff too. This has been observed when using
a layer as cursor layer.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
index 3b371fe7..060f881 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
@@ -118,11 +118,11 @@
#define DCU_CTRLDESCLN(layer, reg) (0x200 + (reg - 1) * 4 + (layer) * 0x40)
-#define DCU_LAYER_HEIGHT(x) ((x) << 16)
-#define DCU_LAYER_WIDTH(x) (x)
+#define DCU_LAYER_HEIGHT(x) (((x) & 0x7ff) << 16)
+#define DCU_LAYER_WIDTH(x) ((x) & 0x7ff)
-#define DCU_LAYER_POSY(x) ((x) << 16)
-#define DCU_LAYER_POSX(x) (x)
+#define DCU_LAYER_POSY(x) (((x) & 0xfff) << 16)
+#define DCU_LAYER_POSX(x) ((x) & 0xfff)
#define DCU_LAYER_EN BIT(31)
#define DCU_LAYER_TILE_EN BIT(30)
--
2.9.3
next prev parent reply other threads:[~2016-09-06 4:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 4:02 [PATCH 0/4] drm/fsl-dcu: add overlay and cursor plane support Stefan Agner
2016-09-06 4:02 ` [PATCH 1/4] drm/fsl-dcu: support overlay and cursor planes Stefan Agner
2016-09-06 4:02 ` Stefan Agner [this message]
2016-09-06 4:02 ` [PATCH 3/4] drm/fsl-dcu: update all registers on flush Stefan Agner
2016-09-07 8:46 ` Meng Yi
2016-09-06 4:02 ` [PATCH 4/4] drm/fsl-dcu: do not update when modifying irq registers Stefan Agner
2016-09-07 8:43 ` [PATCH 0/4] drm/fsl-dcu: add overlay and cursor plane support Meng Yi
2016-09-21 18:13 ` Stefan Agner
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=20160906040233.32471-3-stefan@agner.ch \
--to=stefan@agner.ch \
--cc=alison.wang@freescale.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jianwei.wang.chn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=meng.yi@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).