From: Sam Ravnborg <sam@ravnborg.org>
To: dri-devel@lists.freedesktop.org,
Thierry Reding <thierry.reding@gmail.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
David Airlie <airlied@linux.ie>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Marek Vasut <marex@denx.de>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Sam Ravnborg <sam@ravnborg.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Kukjin Kim <kgene@kernel.org>,
Allison Randal <allison@lohutok.net>,
NXP Linux Team <linux-imx@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Jonas Karlman <jonas@kwiboo.se>,
Alison Wang <alison.wang@nxp.com>,
Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>,
Alexios Zavras <alexios.zavras@intel.com>,
linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>, Sean Paul <sean@poorly.run>,
linux-arm-kernel@lists.infradead.org,
Jernej Skrabec <jernej.skrab>
Subject: [PATCH v1 10/16] drm/panel: ili9322: move bus_flags to get_modes()
Date: Sun, 4 Aug 2019 22:16:31 +0200 [thread overview]
Message-ID: <20190804201637.1240-11-sam@ravnborg.org> (raw)
In-Reply-To: <20190804201637.1240-1-sam@ravnborg.org>
To prepare the driver to receive drm_connector only in the get_modes()
callback, move bus_flags handling to ili9322_get_modes().
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 34 +++++++++-----------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index 53dd1e128795..3c58f63adbf7 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -349,7 +349,6 @@ static const struct regmap_config ili9322_regmap_config = {
static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
{
- struct drm_connector *connector = panel->connector;
u8 reg;
int ret;
int i;
@@ -407,23 +406,11 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
* Polarity and inverted color order for RGB input.
* None of this applies in the BT.656 mode.
*/
- if (ili->conf->dclk_active_high) {
+ reg = 0;
+ if (ili->conf->dclk_active_high)
reg = ILI9322_POL_DCLK;
- connector->display_info.bus_flags |=
- DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE;
- } else {
- reg = 0;
- connector->display_info.bus_flags |=
- DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE;
- }
- if (ili->conf->de_active_high) {
+ if (ili->conf->de_active_high)
reg |= ILI9322_POL_DE;
- connector->display_info.bus_flags |=
- DRM_BUS_FLAG_DE_HIGH;
- } else {
- connector->display_info.bus_flags |=
- DRM_BUS_FLAG_DE_LOW;
- }
if (ili->conf->hsync_active_high)
reg |= ILI9322_POL_HSYNC;
if (ili->conf->vsync_active_high)
@@ -659,9 +646,20 @@ static int ili9322_get_modes(struct drm_panel *panel)
struct drm_connector *connector = panel->connector;
struct ili9322 *ili = panel_to_ili9322(panel);
struct drm_display_mode *mode;
+ struct drm_display_info *info;
+
+ info = &connector->display_info;
+ info->width_mm = ili->conf->width_mm;
+ info->height_mm = ili->conf->height_mm;
+ if (ili->conf->dclk_active_high)
+ info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE;
+ else
+ info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE;
- connector->display_info.width_mm = ili->conf->width_mm;
- connector->display_info.height_mm = ili->conf->height_mm;
+ if (ili->conf->de_active_high)
+ info->bus_flags |= DRM_BUS_FLAG_DE_HIGH;
+ else
+ info->bus_flags |= DRM_BUS_FLAG_DE_LOW;
switch (ili->input) {
case ILI9322_INPUT_SRGB_DUMMY_320X240:
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-08-04 20:17 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-04 20:16 [PATCH v1 0/16] drm: panel related updates Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 01/16] drm/bridge: tc358767: fix opencoded use of drm_panel_* Sam Ravnborg
2019-08-05 9:35 ` Philipp Zabel
2019-08-05 11:53 ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 02/16] drm/exynos: " Sam Ravnborg
2019-12-01 11:32 ` Sam Ravnborg
2019-12-01 11:32 ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 03/16] " Sam Ravnborg
2019-12-01 11:32 ` Sam Ravnborg
2019-12-01 11:32 ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 04/16] drm/imx: " Sam Ravnborg
2019-08-05 9:34 ` Philipp Zabel
2019-08-04 20:16 ` [PATCH v1 05/16] drm/fsl-dcu: " Sam Ravnborg
2019-08-05 9:16 ` Stefan Agner
2019-08-05 11:54 ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 06/16] drm/msm: " Sam Ravnborg
2019-12-01 11:33 ` Sam Ravnborg
2019-12-01 11:33 ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 07/16] drm/mxsfb: " Sam Ravnborg
2019-08-05 9:20 ` Stefan Agner
2019-08-04 20:16 ` [PATCH v1 08/16] drm/sti: " Sam Ravnborg
2019-08-07 11:55 ` Benjamin Gaignard
2019-08-04 20:16 ` [PATCH v1 09/16] drm/tegra: " Sam Ravnborg
2019-12-01 11:33 ` Sam Ravnborg
2019-12-01 11:33 ` Sam Ravnborg
2019-08-04 20:16 ` Sam Ravnborg [this message]
2019-08-06 12:56 ` [PATCH v1 10/16] drm/panel: ili9322: move bus_flags to get_modes() Linus Walleij
2019-08-04 20:16 ` [PATCH v1 11/16] drm/panel: move drm_panel functions to .c file Sam Ravnborg
2019-08-05 10:45 ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 12/16] drm/panel: use inline comments in drm_panel.h Sam Ravnborg
2019-08-05 10:54 ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 13/16] drm/panel: drop return code from drm_panel_detach() Sam Ravnborg
2019-08-05 10:56 ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 14/16] drm/panel: call prepare/enable only once Sam Ravnborg
2019-08-05 10:59 ` Laurent Pinchart
2019-08-05 13:15 ` Emil Velikov
2019-08-05 16:51 ` Sam Ravnborg
2019-12-02 15:22 ` Laurent Pinchart
2019-12-02 15:22 ` Laurent Pinchart
2019-08-05 17:01 ` Sean Paul
2019-12-02 15:15 ` Laurent Pinchart
2019-12-02 15:15 ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 15/16] drm/panel: add backlight support Sam Ravnborg
2019-08-05 11:04 ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 16/16] drm/panel: simple: use drm_panel infrastructure Sam Ravnborg
2019-08-05 11:12 ` Laurent Pinchart
2019-08-05 13:18 ` [PATCH v1 0/16] drm: panel related updates Emil Velikov
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=20190804201637.1240-11-sam@ravnborg.org \
--to=sam@ravnborg.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@linux.ie \
--cc=alexios.zavras@intel.com \
--cc=alison.wang@nxp.com \
--cc=allison@lohutok.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=gwan-gyeong.mun@intel.com \
--cc=jonas@kwiboo.se \
--cc=jonathanh@nvidia.com \
--cc=kernel@pengutronix.de \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=marex@denx.de \
--cc=maxime.ripard@bootlin.com \
--cc=narmstrong@baylibre.com \
--cc=sean@poorly.run \
--cc=tglx@linutronix.de \
--cc=thierry.reding@gmail.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).