From: Shawn Guo <shawnguo@kernel.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH 5/6] drm: tegra: use crtc helper drm_crtc_from_index()
Date: Mon, 9 Jan 2017 19:25:44 +0800 [thread overview]
Message-ID: <1483961145-18453-6-git-send-email-shawnguo@kernel.org> (raw)
In-Reply-To: <1483961145-18453-1-git-send-email-shawnguo@kernel.org>
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>
---
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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-01-09 11:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 11:25 [PATCH 0/6] Use crtc helper drm_crtc_from_index() for more drivers Shawn Guo
2017-01-09 11:25 ` [PATCH 1/6] drm: exynos: use crtc helper drm_crtc_from_index() Shawn Guo
2017-01-18 15:06 ` Sean Paul
2017-01-09 11:25 ` [PATCH 2/6] drm: kirin: " Shawn Guo
2017-01-10 1:21 ` liuxinliang
2017-01-18 15:06 ` Sean Paul
2017-01-09 11:25 ` [PATCH 3/6] drm: mediatek: " Shawn Guo
2017-01-18 15:06 ` Sean Paul
2017-01-09 11:25 ` [PATCH 4/6] drm: nouveau: " Shawn Guo
2017-01-18 15:07 ` Sean Paul
2017-01-09 11:25 ` Shawn Guo [this message]
2017-01-18 15:07 ` [PATCH 5/6] drm: tegra: " Sean Paul
2017-01-09 11:25 ` [PATCH 6/6] drm: vc4: " Shawn Guo
2017-01-18 15:07 ` Sean Paul
2017-01-09 16:11 ` [PATCH 0/6] Use crtc helper drm_crtc_from_index() for more drivers Sean Paul
2017-01-18 15:08 ` Sean Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1483961145-18453-6-git-send-email-shawnguo@kernel.org \
--to=shawnguo@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox