From: "Yannick Fertré" <yannick.fertre@st.com>
To: Yannick Fertre <yannick.fertre@st.com>,
Philippe Cornu <philippe.cornu@st.com>,
Benjamin Gaignard <benjamin.gaignard@st.com>,
Vincent Abriou <vincent.abriou@st.com>,
Gustavo Padovan <gustavo@padovan.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v1 2/2] drm/stm: ltdc: Solve issue on pixel clock & data enable polarity
Date: Mon, 24 Sep 2018 13:36:21 +0200 [thread overview]
Message-ID: <1537788981-21479-3-git-send-email-yannick.fertre@st.com> (raw)
In-Reply-To: <1537788981-21479-1-git-send-email-yannick.fertre@st.com>
Wrong flags used for set the pixel clock & data enable polarities.
Add trace for polarities of hsync, vsync, data enabled & pixel clock.
Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
---
drivers/gpu/drm/stm/ltdc.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 808d9fb..f671abc 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -517,7 +517,7 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
struct videomode vm;
u32 hsync, vsync, accum_hbp, accum_vbp, accum_act_w, accum_act_h;
u32 total_width, total_height;
- u32 val;
+ u32 val = 0;
drm_display_mode_to_videomode(mode, &vm);
@@ -538,7 +538,22 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
total_height = accum_act_h + vm.vfront_porch;
/* Configures the HS, VS, DE and PC polarities. Default Active Low */
- val = 0;
+ if (vm.flags & DISPLAY_FLAGS_HSYNC_LOW)
+ DRM_DEBUG_DRIVER("Horizontal Synchronization polarity is active low");
+ if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
+ DRM_DEBUG_DRIVER("Horizontal Synchronization polarity is active high");
+ if (vm.flags & DISPLAY_FLAGS_VSYNC_LOW)
+ DRM_DEBUG_DRIVER("Vertical Synchronization polarity is active low");
+ if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
+ DRM_DEBUG_DRIVER("Vertical Synchronization polarity is active high");
+ if (vm.flags & DISPLAY_FLAGS_DE_LOW)
+ DRM_DEBUG_DRIVER("Data Enable polarity is active low");
+ if (vm.flags & DISPLAY_FLAGS_DE_HIGH)
+ DRM_DEBUG_DRIVER("Data Enable polarity is active high");
+ if (vm.flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+ DRM_DEBUG_DRIVER("Pixel clock polarity is active low");
+ if (vm.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
+ DRM_DEBUG_DRIVER("Pixel clock polarity is active high");
if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
val |= GCR_HSPOL;
@@ -546,10 +561,10 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
val |= GCR_VSPOL;
- if (vm.flags & DISPLAY_FLAGS_DE_HIGH)
+ if (vm.flags & DISPLAY_FLAGS_DE_LOW)
val |= GCR_DEPOL;
- if (vm.flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+ if (vm.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
val |= GCR_PCPOL;
reg_update_bits(ldev->regs, LTDC_GCR,
--
2.7.4
next prev parent reply other threads:[~2018-09-24 11:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-24 11:36 [PATCH v1 0/2] Manage pixel clock & data enable polarities Yannick Fertré
2018-09-24 11:36 ` [PATCH v1 1/2] drm: Add missing flags for pixel clock & data enable Yannick Fertré
2018-10-15 11:15 ` Benjamin Gaignard
2018-10-23 14:50 ` Benjamin Gaignard
2018-10-24 8:16 ` Daniel Vetter
2018-10-24 8:23 ` Lucas Stach
2018-09-24 11:36 ` Yannick Fertré [this message]
2018-10-15 11:15 ` [PATCH v1 2/2] drm/stm: ltdc: Solve issue on pixel clock & data enable polarity Benjamin Gaignard
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=1537788981-21479-3-git-send-email-yannick.fertre@st.com \
--to=yannick.fertre@st.com \
--cc=airlied@linux.ie \
--cc=benjamin.gaignard@st.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=philippe.cornu@st.com \
--cc=sean@poorly.run \
--cc=vincent.abriou@st.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).