Commit 1d46fea7 authored by Laurent Pinchart's avatar Laurent Pinchart

drm/rcar-du: Use struct videomode in platform data

In preparation for DT support where panel timings will be described by a
DRM-agnostic video mode, replace the struct drm_mode_modeinfo instance
in the panel platform data with a struct videomode.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent cd8968f3
...@@ -41,16 +41,15 @@ static struct rcar_du_encoder_data koelsch_du_encoders[] = { ...@@ -41,16 +41,15 @@ static struct rcar_du_encoder_data koelsch_du_encoders[] = {
.width_mm = 210, .width_mm = 210,
.height_mm = 158, .height_mm = 158,
.mode = { .mode = {
.clock = 65000, .pixelclock = 65000000,
.hdisplay = 1024, .hactive = 1024,
.hsync_start = 1048, .hfront_porch = 20,
.hsync_end = 1184, .hback_porch = 160,
.htotal = 1344, .hsync_len = 136,
.vdisplay = 768, .vactive = 768,
.vsync_start = 771, .vfront_porch = 3,
.vsync_end = 777, .vback_porch = 29,
.vtotal = 806, .vsync_len = 6,
.flags = 0,
}, },
}, },
}, },
......
...@@ -63,16 +63,15 @@ static struct rcar_du_encoder_data koelsch_du_encoders[] = { ...@@ -63,16 +63,15 @@ static struct rcar_du_encoder_data koelsch_du_encoders[] = {
.width_mm = 210, .width_mm = 210,
.height_mm = 158, .height_mm = 158,
.mode = { .mode = {
.clock = 65000, .pixelclock = 65000000,
.hdisplay = 1024, .hactive = 1024,
.hsync_start = 1048, .hfront_porch = 20,
.hsync_end = 1184, .hback_porch = 160,
.htotal = 1344, .hsync_len = 136,
.vdisplay = 768, .vactive = 768,
.vsync_start = 771, .vfront_porch = 3,
.vsync_end = 777, .vback_porch = 29,
.vtotal = 806, .vsync_len = 6,
.flags = 0,
}, },
}, },
}, },
......
...@@ -43,16 +43,15 @@ static struct rcar_du_encoder_data lager_du_encoders[] = { ...@@ -43,16 +43,15 @@ static struct rcar_du_encoder_data lager_du_encoders[] = {
.width_mm = 210, .width_mm = 210,
.height_mm = 158, .height_mm = 158,
.mode = { .mode = {
.clock = 65000, .pixelclock = 65000000,
.hdisplay = 1024, .hactive = 1024,
.hsync_start = 1048, .hfront_porch = 20,
.hsync_end = 1184, .hback_porch = 160,
.htotal = 1344, .hsync_len = 136,
.vdisplay = 768, .vactive = 768,
.vsync_start = 771, .vfront_porch = 3,
.vsync_end = 777, .vback_porch = 29,
.vtotal = 806, .vsync_len = 6,
.flags = 0,
}, },
}, },
}, },
......
...@@ -99,16 +99,15 @@ static struct rcar_du_encoder_data lager_du_encoders[] = { ...@@ -99,16 +99,15 @@ static struct rcar_du_encoder_data lager_du_encoders[] = {
.width_mm = 210, .width_mm = 210,
.height_mm = 158, .height_mm = 158,
.mode = { .mode = {
.clock = 65000, .pixelclock = 65000000,
.hdisplay = 1024, .hactive = 1024,
.hsync_start = 1048, .hfront_porch = 20,
.hsync_end = 1184, .hback_porch = 160,
.htotal = 1344, .hsync_len = 136,
.vdisplay = 768, .vactive = 768,
.vsync_start = 771, .vfront_porch = 3,
.vsync_end = 777, .vback_porch = 29,
.vtotal = 806, .vsync_len = 6,
.flags = 0,
}, },
}, },
}, },
......
...@@ -192,16 +192,15 @@ static struct rcar_du_encoder_data du_encoders[] = { ...@@ -192,16 +192,15 @@ static struct rcar_du_encoder_data du_encoders[] = {
.width_mm = 210, .width_mm = 210,
.height_mm = 158, .height_mm = 158,
.mode = { .mode = {
.clock = 65000, .pixelclock = 65000000,
.hdisplay = 1024, .hactive = 1024,
.hsync_start = 1048, .hfront_porch = 20,
.hsync_end = 1184, .hback_porch = 160,
.htotal = 1344, .hsync_len = 136,
.vdisplay = 768, .vactive = 768,
.vsync_start = 771, .vfront_porch = 3,
.vsync_end = 777, .vback_porch = 29,
.vtotal = 806, .vsync_len = 6,
.flags = 0,
}, },
}, },
}, },
......
...@@ -6,6 +6,7 @@ config DRM_RCAR_DU ...@@ -6,6 +6,7 @@ config DRM_RCAR_DU
select DRM_KMS_CMA_HELPER select DRM_KMS_CMA_HELPER
select DRM_GEM_CMA_HELPER select DRM_GEM_CMA_HELPER
select DRM_KMS_FB_HELPER select DRM_KMS_FB_HELPER
select VIDEOMODE_HELPERS
help help
Choose this option if you have an R-Car chipset. Choose this option if you have an R-Car chipset.
If M is selected the module will be called rcar-du-drm. If M is selected the module will be called rcar-du-drm.
......
...@@ -40,18 +40,9 @@ static int rcar_du_lvds_connector_get_modes(struct drm_connector *connector) ...@@ -40,18 +40,9 @@ static int rcar_du_lvds_connector_get_modes(struct drm_connector *connector)
return 0; return 0;
mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
mode->clock = lvdscon->panel->mode.clock;
mode->hdisplay = lvdscon->panel->mode.hdisplay; drm_display_mode_from_videomode(&lvdscon->panel->mode, mode);
mode->hsync_start = lvdscon->panel->mode.hsync_start;
mode->hsync_end = lvdscon->panel->mode.hsync_end;
mode->htotal = lvdscon->panel->mode.htotal;
mode->vdisplay = lvdscon->panel->mode.vdisplay;
mode->vsync_start = lvdscon->panel->mode.vsync_start;
mode->vsync_end = lvdscon->panel->mode.vsync_end;
mode->vtotal = lvdscon->panel->mode.vtotal;
mode->flags = lvdscon->panel->mode.flags;
drm_mode_set_name(mode);
drm_mode_probed_add(connector, mode); drm_mode_probed_add(connector, mode);
return 1; return 1;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#ifndef __RCAR_DU_H__ #ifndef __RCAR_DU_H__
#define __RCAR_DU_H__ #define __RCAR_DU_H__
#include <drm/drm_mode.h> #include <video/videomode.h>
enum rcar_du_output { enum rcar_du_output {
RCAR_DU_OUTPUT_DPAD0, RCAR_DU_OUTPUT_DPAD0,
...@@ -35,7 +35,7 @@ enum rcar_du_encoder_type { ...@@ -35,7 +35,7 @@ enum rcar_du_encoder_type {
struct rcar_du_panel_data { struct rcar_du_panel_data {
unsigned int width_mm; /* Panel width in mm */ unsigned int width_mm; /* Panel width in mm */
unsigned int height_mm; /* Panel height in mm */ unsigned int height_mm; /* Panel height in mm */
struct drm_mode_modeinfo mode; struct videomode mode;
}; };
struct rcar_du_connector_lvds_data { struct rcar_du_connector_lvds_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment