Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371374
b: refs/heads/master
c: bddabbe
h: refs/heads/master
v: v3
  • Loading branch information
Archit Taneja authored and Tomi Valkeinen committed Apr 11, 2013
1 parent 67ed20a commit 5a14a0b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 581382e31090aa2459e8046e0bafb0f1daa2ecd8
refs/heads/master: bddabbe174cfb6f944baaf13ed5b93c6ee89ec3d
27 changes: 25 additions & 2 deletions trunk/drivers/gpu/drm/omapdrm/omap_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ static enum drm_connector_status omap_connector_detect(
ret = connector_status_connected;
else
ret = connector_status_disconnected;
} else if (dssdev->type == OMAP_DISPLAY_TYPE_DPI ||
dssdev->type == OMAP_DISPLAY_TYPE_DBI ||
dssdev->type == OMAP_DISPLAY_TYPE_SDI ||
dssdev->type == OMAP_DISPLAY_TYPE_DSI) {
ret = connector_status_connected;
} else {
ret = connector_status_unknown;
}
Expand Down Expand Up @@ -189,12 +194,30 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
struct omap_video_timings timings = {0};
struct drm_device *dev = connector->dev;
struct drm_display_mode *new_mode;
int ret = MODE_BAD;
int r, ret = MODE_BAD;

copy_timings_drm_to_omap(&timings, mode);
mode->vrefresh = drm_mode_vrefresh(mode);

if (!dssdrv->check_timings(dssdev, &timings)) {
/*
* if the panel driver doesn't have a check_timings, it's most likely
* a fixed resolution panel, check if the timings match with the
* panel's timings
*/
if (dssdrv->check_timings) {
r = dssdrv->check_timings(dssdev, &timings);
} else {
struct omap_video_timings t = {0};

dssdrv->get_timings(dssdev, &t);

if (memcmp(&timings, &t, sizeof(struct omap_video_timings)))
r = -EINVAL;
else
r = 0;
}

if (!r) {
/* check if vrefresh is still valid */
new_mode = drm_mode_duplicate(dev, mode);
new_mode->clock = timings.pixel_clock;
Expand Down
17 changes: 15 additions & 2 deletions trunk/drivers/gpu/drm/omapdrm/omap_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,26 @@ int omap_encoder_update(struct drm_encoder *encoder,

dssdev->output->manager = mgr;

ret = dssdrv->check_timings(dssdev, timings);
if (dssdrv->check_timings) {
ret = dssdrv->check_timings(dssdev, timings);
} else {
struct omap_video_timings t = {0};

dssdrv->get_timings(dssdev, &t);

if (memcmp(timings, &t, sizeof(struct omap_video_timings)))
ret = -EINVAL;
else
ret = 0;
}

if (ret) {
dev_err(dev->dev, "could not set timings: %d\n", ret);
return ret;
}

dssdrv->set_timings(dssdev, timings);
if (dssdrv->set_timings)
dssdrv->set_timings(dssdev, timings);

return 0;
}
Expand Down

0 comments on commit 5a14a0b

Please sign in to comment.