Message ID | 1464808681-1970-1-git-send-email-eric@anholt.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Jun 01, 2016 at 12:18:01PM -0700, Eric Anholt wrote: > It appears to have no callers. > > Signed-off-by: Eric Anholt <eric@anholt.net> > --- > drivers/gpu/drm/panel/panel-simple.c | 18 ------------------ > include/drm/drm_panel.h | 4 ---- > 2 files changed, 22 deletions(-) Looks like I never replied to this, though I remember at least making up the reply in my head. The reason why I'd like to keep this is that it's technically the right interface for display drivers to use. It was introduced in order to fix some of the short-comings of ->get_modes(), though it seems like there simply hasn't been a need so far for drivers to do this. The problem with ->get_modes() is that it gives you a fixed mode for most panels. However, a mode that works on one display controller does not necessarily work on another (typical reasons could be extra limits imposed on porches by the display controller). Timings are supposed to solve this by allowing the video timings to be specified in triplets of (minimum, maximum, typical) values for each of the parameters (much like the tables you see in panel datasheets) and make it possible for drivers to make up a valid mode from those ranges. This makes the panel more widely useful. At least that's the theory, but, like I said, in practice nobody seems to be needing this currently. Bottom line, I think we'll be needing this down the road eventually, so keeping it around will avoid unnecessary churn. Thierry
Thierry Reding <thierry.reding@gmail.com> writes: > On Wed, Jun 01, 2016 at 12:18:01PM -0700, Eric Anholt wrote: >> It appears to have no callers. >> >> Signed-off-by: Eric Anholt <eric@anholt.net> >> --- >> drivers/gpu/drm/panel/panel-simple.c | 18 ------------------ >> include/drm/drm_panel.h | 4 ---- >> 2 files changed, 22 deletions(-) > > Looks like I never replied to this, though I remember at least making up > the reply in my head. > > The reason why I'd like to keep this is that it's technically the right > interface for display drivers to use. It was introduced in order to fix > some of the short-comings of ->get_modes(), though it seems like there > simply hasn't been a need so far for drivers to do this. OK. That makes some sense then. I was writing a new panel driver, and it was confusing to have this unused code in panel-simple that I was deriving from.
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 3a7bdf1c842b..3c7eb0ac1298 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -265,30 +265,12 @@ static int panel_simple_get_modes(struct drm_panel *panel) return num; } -static int panel_simple_get_timings(struct drm_panel *panel, - unsigned int num_timings, - struct display_timing *timings) -{ - struct panel_simple *p = to_panel_simple(panel); - unsigned int i; - - if (p->desc->num_timings < num_timings) - num_timings = p->desc->num_timings; - - if (timings) - for (i = 0; i < num_timings; i++) - timings[i] = p->desc->timings[i]; - - return p->desc->num_timings; -} - static const struct drm_panel_funcs panel_simple_funcs = { .disable = panel_simple_disable, .unprepare = panel_simple_unprepare, .prepare = panel_simple_prepare, .enable = panel_simple_enable, .get_modes = panel_simple_get_modes, - .get_timings = panel_simple_get_timings, }; static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 220d1e2b3db1..f1dfee3e97c6 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -39,8 +39,6 @@ struct display_timing; * @enable: enable panel (turn on back light, etc.) * @get_modes: add modes to the connector that the panel is attached to and * return the number of modes added - * @get_timings: copy display timings into the provided array and return - * the number of display timings available * * The .prepare() function is typically called before the display controller * starts to transmit video data. Panel drivers can use this to turn the panel @@ -71,8 +69,6 @@ struct drm_panel_funcs { int (*prepare)(struct drm_panel *panel); int (*enable)(struct drm_panel *panel); int (*get_modes)(struct drm_panel *panel); - int (*get_timings)(struct drm_panel *panel, unsigned int num_timings, - struct display_timing *timings); }; /**
It appears to have no callers. Signed-off-by: Eric Anholt <eric@anholt.net> --- drivers/gpu/drm/panel/panel-simple.c | 18 ------------------ include/drm/drm_panel.h | 4 ---- 2 files changed, 22 deletions(-)