Skip to contentSkip to conversation

drm/exynos: calculate vrefresh instead of use a fixed value

PATCH Superseded Gustavo Padovan 2 participants 3 messages May 20, 2015

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/exynos: calculate vrefresh instead of use a fixed value

From: Gustavo Padovan <[email protected]>

When mode's vrefresh is zero we should ask DRM core to calculate vrefresh for us so we can get the correct value instead of relying on fixed value defined in a macro. But if vrefresh is still zero we should fail the update.

---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -2
index 9819fa6..ea7da0e 100644
@@ -42,7 +42,6 @@
  * CPU Interface.
  */
 
-#define FIMD_DEFAULT_FRAMERATE 60
 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
 
 /* position control register for hardware window 0, 2 ~ 4.*/
@@ -329,7 +328,9 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc,
 		struct drm_display_mode *adjusted_mode)
 {
 	if (adjusted_mode->vrefresh == 0)
-		adjusted_mode->vrefresh = FIMD_DEFAULT_FRAMERATE;
+		adjusted_mode->vrefresh = drm_mode_vrefresh(mode);
+	if (adjusted_mode->vrefresh == 0)
+		return false;
 
 	return true;
 }
Signature · 6 lines
2.1.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 6 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

When mode's vrefresh is zero we should ask DRM core to calculate vrefresh for us so we can get the correct value instead of relying on fixed value defined in a macro. But if vrefresh is still zero we should fail the update.

Even with this we still need to consider crtc->state->adjusted_mode in fimd_commit(), otherwise vrefresh computed by drm_mode_vrefresh() is never actually used.

With best wishes,
Tobias

Quoted 20 lines
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -1
index 9819fa6..ea7da0e 100644
@@ -42,7 +42,6 @@
  * CPU Interface.
  */
 
-#define FIMD_DEFAULT_FRAMERATE 60
 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
 
 /* position control register for hardware window 0, 2 ~ 4.*/

drivers/gpu/drm/exynos/exynos_drm_fimd.c static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, · line 336

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -1
@@ -329,7 +328,9 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc,
 		struct drm_display_mode *adjusted_mode)
 {
 	if (adjusted_mode->vrefresh == 0)
-		adjusted_mode->vrefresh = FIMD_DEFAULT_FRAMERATE;
+		adjusted_mode->vrefresh = drm_mode_vrefresh(mode);
+	if (adjusted_mode->vrefresh == 0)
+		return false;
 
 	return true;
 }

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

2015-05-20 Tobias Jakobi <[email protected]>:

Quoted 10 lines
Quoted 6 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

When mode's vrefresh is zero we should ask DRM core to calculate vrefresh for us so we can get the correct value instead of relying on fixed value defined in a macro. But if vrefresh is still zero we should fail the update.

Even with this we still need to consider crtc->state->adjusted_mode in fimd_commit(), otherwise vrefresh computed by drm_mode_vrefresh() is never actually used.

You are right, I think we should pass crtc->state->adjusted_mode to fimd_calc_clkdiv(). I'll send a v3 with this change.

Gustavo