Change-Id: I88997563d45f4f0c06ea0df746c0b8abf518f310
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
if (mode->clock > 165000)
return MODE_CLOCK_HIGH;
if (mode->clock > 165000)
return MODE_CLOCK_HIGH;
- if (mode->flags & DRM_MODE_FLAG_INTERLACE)
- return MODE_NO_INTERLACE;
-
+ .drgbs_bit = 0,
+ .max_xres = 1920,
+ .max_yres = 1080,
+ .interlace = false,
};
static const struct rcar_du_device_info rcar_du_r8a7791_info = {
};
static const struct rcar_du_device_info rcar_du_r8a7791_info = {
+ .drgbs_bit = 1,
+ .max_xres = 1920,
+ .max_yres = 1080,
+ .interlace = true,
};
static const struct platform_device_id rcar_du_id_table[] = {
};
static const struct platform_device_id rcar_du_id_table[] = {
unsigned int num_crtcs;
struct rcar_du_output_routing routes[RCAR_DU_OUTPUT_MAX];
unsigned int num_lvds;
unsigned int num_crtcs;
struct rcar_du_output_routing routes[RCAR_DU_OUTPUT_MAX];
unsigned int num_lvds;
+ unsigned int drgbs_bit;
+ unsigned int max_xres;
+ unsigned int max_yres;
+ bool interlace;
};
struct rcar_du_device {
};
struct rcar_du_device {
struct rcar_du_connector *con = to_rcar_connector(connector);
struct drm_encoder *encoder = rcar_encoder_to_drm_encoder(con->encoder);
struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder);
struct rcar_du_connector *con = to_rcar_connector(connector);
struct drm_encoder *encoder = rcar_encoder_to_drm_encoder(con->encoder);
struct drm_encoder_slave_funcs *sfuncs = to_slave_funcs(encoder);
+ struct rcar_du_device *rcdu = connector->dev->dev_private;
+ unsigned int max_width, max_height;
+ bool laced;
+
+ max_width = rcdu->info->max_xres;
+ max_height = rcdu->info->max_yres;
+ laced = rcdu->info->interlace;
+
+ if ((mode->hdisplay * mode->vdisplay) > (max_width * max_height))
+ return MODE_BAD_WIDTH;
+
+ if (((mode->hdisplay * mode->vdisplay) == (max_width * max_height))
+ && (laced) && (!(mode->flags & DRM_MODE_FLAG_INTERLACE)))
+ return MODE_BAD;
if (sfuncs->mode_valid == NULL)
return MODE_OK;
if (sfuncs->mode_valid == NULL)
return MODE_OK;