From: Philipp Zabel <p.zabel@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] video: add VPL ioctl to get bus format
Date: Wed, 24 Aug 2016 12:40:18 +0200 [thread overview]
Message-ID: <1472035219-23917-2-git-send-email-p.zabel@pengutronix.de> (raw)
In-Reply-To: <1472035219-23917-1-git-send-email-p.zabel@pengutronix.de>
The i.MX specific DI_MODE VPL ioctl already allows to query the encoder
input bus format. This patch also allows non-i.MX specific encoder drivers
to report their input bus format.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/video/imx-ipu-v3/ipufb.c | 8 ++++++--
include/video/vpl.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/video/imx-ipu-v3/ipufb.c b/drivers/video/imx-ipu-v3/ipufb.c
index cfafa22..63024b5 100644
--- a/drivers/video/imx-ipu-v3/ipufb.c
+++ b/drivers/video/imx-ipu-v3/ipufb.c
@@ -109,7 +109,7 @@ int ipu_crtc_mode_set(struct ipufb_info *fbi,
int ret;
struct ipu_di_signal_cfg sig_cfg = {};
struct ipu_di_mode di_mode = {};
- u32 bus_format;
+ u32 bus_format = 0;
dev_info(fbi->dev, "%s: mode->xres: %d\n", __func__,
mode->xres);
@@ -117,7 +117,11 @@ int ipu_crtc_mode_set(struct ipufb_info *fbi,
mode->yres);
vpl_ioctl(&fbi->vpl, 2 + fbi->dino, IMX_IPU_VPL_DI_MODE, &di_mode);
- bus_format = di_mode.bus_format ?: fbi->bus_format;
+ vpl_ioctl(&fbi->vpl, 2 + fbi->dino, VPL_GET_BUS_FORMAT, &bus_format);
+ if (bus_format)
+ di_mode.di_clkflags = IPU_DI_CLKMODE_NON_FRACTIONAL;
+ else
+ bus_format = di_mode.bus_format ?: fbi->bus_format;
if (mode->sync & FB_SYNC_HOR_HIGH_ACT)
sig_cfg.Hsync_pol = 1;
diff --git a/include/video/vpl.h b/include/video/vpl.h
index 846007f..6ae7b0f 100644
--- a/include/video/vpl.h
+++ b/include/video/vpl.h
@@ -8,6 +8,7 @@
#define VPL_ENABLE 0x67660003
#define VPL_DISABLE 0x67660004
#define VPL_GET_VIDEOMODES 0x67660005
+#define VPL_GET_BUS_FORMAT 0x67660006
struct vpl {
int (*ioctl)(struct vpl *, unsigned int port,
--
2.8.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-08-24 10:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 10:40 [PATCH 1/3] video: switch to media bus formats Philipp Zabel
2016-08-24 10:40 ` Philipp Zabel [this message]
2016-08-24 10:40 ` [PATCH 3/3] video: tc358767: add eDP video encoder driver Philipp Zabel
2016-08-25 6:28 ` [PATCH 1/3] video: switch to media bus formats Sascha Hauer
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=1472035219-23917-2-git-send-email-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox