linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Daniel Vetter <daniel.vetter@intel.com>, David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	linux-arm-kernel@lists.infradead.org,
	Hans de Goede <hdegoede@redhat.com>, Chen-Yu Tsai <wens@csie.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] drm/sun4i: Compute TCON1 mode from tv mode
Date: Tue, 18 Oct 2016 10:29:37 +0200	[thread overview]
Message-ID: <c2736e784c776479a251d3ddea5dd330eeb7e896.1476779323.git-series.maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <cover.bb9be34c7fd7767e31823f78a15ae1c127293c34.1476779323.git-series.maxime.ripard@free-electrons.com>
In-Reply-To: <cover.bb9be34c7fd7767e31823f78a15ae1c127293c34.1476779323.git-series.maxime.ripard@free-electrons.com>

Since the mode passed in mode_set is probably going to be a scaled down
version of the TV mode, we cannot just use it.

Instead, try to retrieve the actual mode we want to set, and generate a drm
mode from that.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/gpu/drm/sun4i/sun4i_tv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index 6f8077013be3..f99886462cb8 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -401,8 +401,13 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
 	struct sun4i_drv *drv = tv->drv;
 	struct sun4i_tcon *tcon = drv->tcon;
 	const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode);
+	struct drm_display_mode tv_drm_mode = { 0 };
 
-	sun4i_tcon1_mode_set(tcon, mode);
+	strcpy(tv_drm_mode.name, "TV");
+	sun4i_tv_mode_to_drm_mode(tv_mode, &tv_drm_mode);
+	drm_mode_set_crtcinfo(&tv_drm_mode, CRTC_INTERLACE_HALVE_V);
+
+	sun4i_tcon1_mode_set(tcon, &tv_drm_mode);
 
 	/* Enable and map the DAC to the output */
 	regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG,
-- 
git-series 0.8.10

  parent reply	other threads:[~2016-10-18  8:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18  8:29 [PATCH 0/5] drm/sun4i: Handle TV overscan Maxime Ripard
2016-10-18  8:29 ` [PATCH 1/5] drm/modes: Rewrite the command line parser Maxime Ripard
2016-11-16 17:12   ` Sean Paul
2016-11-21  7:36     ` Maxime Ripard
2016-10-18  8:29 ` [PATCH 2/5] drm/modes: Support modes names on the command line Maxime Ripard
2016-11-16 17:21   ` Sean Paul
2016-11-21  7:40     ` Maxime Ripard
2016-10-18  8:29 ` [PATCH 3/5] drm/sun4i: Add custom crtc state Maxime Ripard
2016-10-18  8:29 ` Maxime Ripard [this message]
2016-10-18  8:29 ` [PATCH 5/5] drm/sun4i: Add support for the overscan profiles Maxime Ripard
2016-11-08  8:59   ` Daniel Vetter
2016-11-10 14:56     ` Maxime Ripard
2016-11-11  9:17       ` Daniel Vetter
2016-11-21  7:30         ` Maxime Ripard
2016-10-18  9:24 ` [PATCH 0/5] drm/sun4i: Handle TV overscan Russell King - ARM Linux
2016-10-18 10:03   ` Maxime Ripard
2016-10-18 17:57     ` Jean-Francois Moine
2016-10-31  8:42     ` Russell King - ARM Linux
2016-11-03  9:01       ` Maxime Ripard
2016-11-03  9:54         ` Russell King - ARM Linux
2016-11-07 15:09           ` Maxime Ripard
2016-11-07 15:46             ` Russell King - ARM Linux
2016-11-10 14:25               ` Maxime Ripard
2016-11-03 21:11         ` Sean Paul
2016-11-07 14:11           ` Maxime Ripard

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=c2736e784c776479a251d3ddea5dd330eeb7e896.1476779323.git-series.maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --cc=airlied@linux.ie \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).