Skip to content

Commit 138fe53

Browse files
pinchartltomba
authored andcommitted
drm/omap: Remove unneeded fallback for missing .check_timings()
The .check_timings() operation is present in all panels and connectors. The fallback that uses .get_timings() in the absence of .check_timings() is thus unneeded. While it could be argued that the fallback implements a useful check that should be extended to cover all fixed-resolution panels, the code is currently unused and gets in the way of the ongoing refactoring. Remove it, a similar feature can always be added later. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
1 parent bb23800 commit 138fe53

File tree

2 files changed

+3
-38
lines changed

2 files changed

+3
-38
lines changed

drivers/gpu/drm/omapdrm/omap_connector.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -261,30 +261,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
261261
drm_display_mode_to_videomode(mode, &vm);
262262
mode->vrefresh = drm_mode_vrefresh(mode);
263263

264-
/*
265-
* if the panel driver doesn't have a check_timings, it's most likely
266-
* a fixed resolution panel, check if the timings match with the
267-
* panel's timings
268-
*/
269-
if (dssdev->ops->check_timings) {
270-
r = dssdev->ops->check_timings(dssdev, &vm);
271-
} else {
272-
struct videomode t = {0};
273-
274-
dssdev->ops->get_timings(dssdev, &t);
275-
276-
/*
277-
* Ignore the flags, as we don't get them from
278-
* drm_display_mode_to_videomode.
279-
*/
280-
t.flags = 0;
281-
282-
if (memcmp(&vm, &t, sizeof(vm)))
283-
r = -EINVAL;
284-
else
285-
r = 0;
286-
}
287-
264+
r = dssdev->ops->check_timings(dssdev, &vm);
288265
if (!r) {
289266
/* check if vrefresh is still valid */
290267
new_mode = drm_mode_duplicate(dev, mode);

drivers/gpu/drm/omapdrm/omap_encoder.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,9 @@ static int omap_encoder_update(struct drm_encoder *encoder,
101101
struct omap_dss_device *dssdev = omap_encoder->display;
102102
int ret;
103103

104-
if (dssdev->ops->check_timings) {
105-
ret = dssdev->ops->check_timings(dssdev, vm);
106-
} else {
107-
struct videomode t = {0};
108-
109-
dssdev->ops->get_timings(dssdev, &t);
110-
111-
if (memcmp(vm, &t, sizeof(*vm)))
112-
ret = -EINVAL;
113-
else
114-
ret = 0;
115-
}
116-
104+
ret = dssdev->ops->check_timings(dssdev, vm);
117105
if (ret) {
118-
dev_err(dev->dev, "could not set timings: %d\n", ret);
106+
dev_err(dev->dev, "invalid timings: %d\n", ret);
119107
return ret;
120108
}
121109

0 commit comments

Comments
 (0)