Message ID | 1483961145-18453-6-git-send-email-shawnguo@kernel.org |
---|---|
State | New |
Headers | show |
On Mon, Jan 9, 2017 at 6:25 AM, Shawn Guo <shawnguo@kernel.org> wrote: > From: Shawn Guo <shawn.guo@linaro.org> > > Function tegra_crtc_from_pipe() does the exactly same thing as what > crtc helper drm_crtc_from_index() provides. Use the helper to save > some code. > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > Cc: Thierry Reding <thierry.reding@gmail.com> Applied to drm-misc-next Thanks! Sean > --- > drivers/gpu/drm/tegra/drm.c | 19 +++---------------- > 1 file changed, 3 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c > index b8be3ee4d3b8..e8ad2c1bfc76 100644 > --- a/drivers/gpu/drm/tegra/drm.c > +++ b/drivers/gpu/drm/tegra/drm.c > @@ -806,23 +806,10 @@ static int tegra_gem_get_flags(struct drm_device *drm, void *data, > .llseek = noop_llseek, > }; > > -static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm, > - unsigned int pipe) > -{ > - struct drm_crtc *crtc; > - > - list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) { > - if (pipe == drm_crtc_index(crtc)) > - return crtc; > - } > - > - return NULL; > -} > - > static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, > unsigned int pipe) > { > - struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); > + struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe); > struct tegra_dc *dc = to_tegra_dc(crtc); > > if (!crtc) > @@ -833,7 +820,7 @@ static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, > > static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) > { > - struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); > + struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe); > struct tegra_dc *dc = to_tegra_dc(crtc); > > if (!crtc) > @@ -846,7 +833,7 @@ static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) > > static void tegra_drm_disable_vblank(struct drm_device *drm, unsigned int pipe) > { > - struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); > + struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe); > struct tegra_dc *dc = to_tegra_dc(crtc); > > if (crtc) > -- > 1.9.1 >
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index b8be3ee4d3b8..e8ad2c1bfc76 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -806,23 +806,10 @@ static int tegra_gem_get_flags(struct drm_device *drm, void *data, .llseek = noop_llseek, }; -static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm, - unsigned int pipe) -{ - struct drm_crtc *crtc; - - list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) { - if (pipe == drm_crtc_index(crtc)) - return crtc; - } - - return NULL; -} - static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, unsigned int pipe) { - struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); + struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe); struct tegra_dc *dc = to_tegra_dc(crtc); if (!crtc) @@ -833,7 +820,7 @@ static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) { - struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); + struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe); struct tegra_dc *dc = to_tegra_dc(crtc); if (!crtc) @@ -846,7 +833,7 @@ static int tegra_drm_enable_vblank(struct drm_device *drm, unsigned int pipe) static void tegra_drm_disable_vblank(struct drm_device *drm, unsigned int pipe) { - struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe); + struct drm_crtc *crtc = drm_crtc_from_index(drm, pipe); struct tegra_dc *dc = to_tegra_dc(crtc); if (crtc)