All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Inki Dae <inki.dae@samsung.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	dri-devel@lists.freedesktop.org,
	linux-samsung-soc@vger.kernel.org,
	Tobias Jakobi <tjakobi@math.uni-bielefeld.de>,
	Daniel Drake <drake@endlessm.com>
Subject: [PATCH 07/10] drm/exynos: add mode_fixup callback to exynos_drm_crtc_ops
Date: Wed, 06 Sep 2017 12:36:57 +0200	[thread overview]
Message-ID: <1504694220-15818-8-git-send-email-a.hajda@samsung.com> (raw)
In-Reply-To: <1504694220-15818-1-git-send-email-a.hajda@samsung.com>

crtc::mode_fixup callback is required by crtcs which use internally
different mode than requested by user - case of Exynos Mixer.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 15 +++++++++++++++
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 6ce0821..dc01342 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -95,8 +95,23 @@ static enum drm_mode_status exynos_crtc_mode_valid(struct drm_crtc *crtc,
 	return MODE_OK;
 }
 
+static bool exynos_crtc_mode_fixup(struct drm_crtc *crtc,
+		const struct drm_display_mode *mode,
+		struct drm_display_mode *adjusted_mode)
+{
+	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
+
+	if (exynos_crtc->ops->mode_fixup)
+		return exynos_crtc->ops->mode_fixup(exynos_crtc, mode,
+				adjusted_mode);
+
+	return true;
+}
+
+
 static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
 	.mode_valid	= exynos_crtc_mode_valid,
+	.mode_fixup	= exynos_crtc_mode_fixup,
 	.atomic_check	= exynos_crtc_atomic_check,
 	.atomic_begin	= exynos_crtc_atomic_begin,
 	.atomic_flush	= exynos_crtc_atomic_flush,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index cf131c2..e8bcc72 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -136,6 +136,9 @@ struct exynos_drm_crtc_ops {
 	u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc);
 	enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc,
 		const struct drm_display_mode *mode);
+	bool (*mode_fixup)(struct exynos_drm_crtc *crtc,
+			   const struct drm_display_mode *mode,
+			   struct drm_display_mode *adjusted_mode);
 	int (*atomic_check)(struct exynos_drm_crtc *crtc,
 			    struct drm_crtc_state *state);
 	void (*atomic_begin)(struct exynos_drm_crtc *crtc);
-- 
2.7.4

  parent reply	other threads:[~2017-09-06 10:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170906103727eucas1p23614a8da470a625d760b50095a4a4ad1@eucas1p2.samsung.com>
2017-09-06 10:36 ` [PATCH 00/10] drm/exynos: TV path improvements Andrzej Hajda
     [not found]   ` <CGME20170906103728eucas1p2f32e4a98f0e034c68fa425efb5ac8269@eucas1p2.samsung.com>
2017-09-06 10:36     ` [PATCH 01/10] drm/exynos/mixer: abstract out output mode setup code Andrzej Hajda
2017-09-12 12:29       ` Tobias Jakobi
2017-09-12 13:16         ` Andrzej Hajda
     [not found]   ` <CGME20170906103728eucas1p24e0495f4f1a7534df3d649b0a9c8aff0@eucas1p2.samsung.com>
2017-09-06 10:36     ` [PATCH 02/10] drm/exynos/mixer: move mode commit to enable callback Andrzej Hajda
2017-09-12 12:29       ` Tobias Jakobi
     [not found]   ` <CGME20170906103729eucas1p1ea88d3ce8fc8d7c07f71fcdc12a5d4d0@eucas1p1.samsung.com>
2017-09-06 10:36     ` [PATCH 03/10] drm/exynos/mixer: move resolution configuration to single function Andrzej Hajda
2017-09-12 12:29       ` Tobias Jakobi
     [not found]   ` <CGME20170906103729eucas1p1844077cd598fb44535719925f3279c6e@eucas1p1.samsung.com>
2017-09-06 10:36     ` [PATCH 04/10] drm/exynos/mixer: fix mode validation code Andrzej Hajda
2017-09-12 12:31       ` Tobias Jakobi
2017-09-12 13:26         ` Andrzej Hajda
     [not found]   ` <CGME20170906103729eucas1p2501fa97ae744536e3bdc7dd59aca39c0@eucas1p2.samsung.com>
2017-09-06 10:36     ` [PATCH 05/10] drm/exynos/mixer: remove mixer_resources sub-structure Andrzej Hajda
2017-09-12 12:32       ` Tobias Jakobi
     [not found]   ` <CGME20170906103730eucas1p2678e273a036b1fb02b5d1d51fa5fc20d@eucas1p2.samsung.com>
2017-09-06 10:36     ` [PATCH 06/10] drm/exynos/hdmi: remove redundant mode field Andrzej Hajda
2017-09-12 12:33       ` Tobias Jakobi
     [not found]   ` <CGME20170906103730eucas1p182c799cf23b889626dde869bbad3250c@eucas1p1.samsung.com>
2017-09-06 10:36     ` Andrzej Hajda [this message]
2017-09-12 12:41       ` [PATCH 07/10] drm/exynos: add mode_fixup callback to exynos_drm_crtc_ops Tobias Jakobi
2017-09-12 13:28         ` Andrzej Hajda
     [not found]   ` <CGME20170906103731eucas1p2a9e4a72215d719fcb0b98096de7bd86f@eucas1p2.samsung.com>
2017-09-06 10:36     ` [PATCH 08/10] drm/exynos/mixer: pass actual mode on MIXER to encoder Andrzej Hajda
2017-09-12 12:49       ` Tobias Jakobi
     [not found]   ` <CGME20170906103731eucas1p24ec3d9de21453732de868960553b5e8d@eucas1p2.samsung.com>
2017-09-06 10:36     ` [PATCH 09/10] drm/exynos/hdmi: quirk for support mode timings conversion Andrzej Hajda
2017-09-12 12:50       ` Tobias Jakobi
2017-09-12 13:32         ` Andrzej Hajda
     [not found]   ` <CGME20170906103732eucas1p16966a1fd86daf50dc2b5217dfb90785d@eucas1p1.samsung.com>
2017-09-06 10:37     ` [PATCH 10/10] drm/exynos/mixer: enable support for 1024x768 and 1280x1024 modes Andrzej Hajda
2017-09-12 12:50       ` Tobias Jakobi
2017-09-12 13:37         ` Andrzej Hajda
2017-09-11 13:54   ` [PATCH 00/10] drm/exynos: TV path improvements Tobias Jakobi
2017-09-12  5:54     ` Andrzej Hajda

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=1504694220-15818-8-git-send-email-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=drake@endlessm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=tjakobi@math.uni-bielefeld.de \
    /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.