提交 d4b20e4d 编写于 作者: T Thierry Reding 提交者: Daniel Vetter

drm/imx: Drop pipe field from struct imx_drm_crtc

Use the drm_crtc_index() helper to determine the pipe number of the CRTC
instead.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: NPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: NThierry Reding <treding@nvidia.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450178476-26284-5-git-send-email-boris.brezillon@free-electrons.comSigned-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 d2ab8ad9
...@@ -45,7 +45,6 @@ struct imx_drm_device { ...@@ -45,7 +45,6 @@ struct imx_drm_device {
struct imx_drm_crtc { struct imx_drm_crtc {
struct drm_crtc *crtc; struct drm_crtc *crtc;
unsigned int pipe;
struct imx_drm_crtc_helper_funcs imx_drm_helper_funcs; struct imx_drm_crtc_helper_funcs imx_drm_helper_funcs;
}; };
...@@ -56,7 +55,7 @@ module_param(legacyfb_depth, int, 0444); ...@@ -56,7 +55,7 @@ module_param(legacyfb_depth, int, 0444);
unsigned int imx_drm_crtc_id(struct imx_drm_crtc *crtc) unsigned int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
{ {
return crtc->pipe; return drm_crtc_index(crtc->crtc);
} }
EXPORT_SYMBOL_GPL(imx_drm_crtc_id); EXPORT_SYMBOL_GPL(imx_drm_crtc_id);
...@@ -124,19 +123,19 @@ EXPORT_SYMBOL_GPL(imx_drm_set_bus_format); ...@@ -124,19 +123,19 @@ EXPORT_SYMBOL_GPL(imx_drm_set_bus_format);
int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc) int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc)
{ {
return drm_vblank_get(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe); return drm_crtc_vblank_get(imx_drm_crtc->crtc);
} }
EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_get); EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_get);
void imx_drm_crtc_vblank_put(struct imx_drm_crtc *imx_drm_crtc) void imx_drm_crtc_vblank_put(struct imx_drm_crtc *imx_drm_crtc)
{ {
drm_vblank_put(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe); drm_crtc_vblank_put(imx_drm_crtc->crtc);
} }
EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_put); EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_put);
void imx_drm_handle_vblank(struct imx_drm_crtc *imx_drm_crtc) void imx_drm_handle_vblank(struct imx_drm_crtc *imx_drm_crtc)
{ {
drm_handle_vblank(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe); drm_crtc_handle_vblank(imx_drm_crtc->crtc);
} }
EXPORT_SYMBOL_GPL(imx_drm_handle_vblank); EXPORT_SYMBOL_GPL(imx_drm_handle_vblank);
...@@ -356,12 +355,11 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc, ...@@ -356,12 +355,11 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
return -ENOMEM; return -ENOMEM;
imx_drm_crtc->imx_drm_helper_funcs = *imx_drm_helper_funcs; imx_drm_crtc->imx_drm_helper_funcs = *imx_drm_helper_funcs;
imx_drm_crtc->pipe = imxdrm->pipes++;
imx_drm_crtc->crtc = crtc; imx_drm_crtc->crtc = crtc;
crtc->port = port; crtc->port = port;
imxdrm->crtc[imx_drm_crtc->pipe] = imx_drm_crtc; imxdrm->crtc[imxdrm->pipes++] = imx_drm_crtc;
*new_crtc = imx_drm_crtc; *new_crtc = imx_drm_crtc;
...@@ -378,7 +376,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc, ...@@ -378,7 +376,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
return 0; return 0;
err_register: err_register:
imxdrm->crtc[imx_drm_crtc->pipe] = NULL; imxdrm->crtc[--imxdrm->pipes] = NULL;
kfree(imx_drm_crtc); kfree(imx_drm_crtc);
return ret; return ret;
} }
...@@ -390,10 +388,11 @@ EXPORT_SYMBOL_GPL(imx_drm_add_crtc); ...@@ -390,10 +388,11 @@ EXPORT_SYMBOL_GPL(imx_drm_add_crtc);
int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc) int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc)
{ {
struct imx_drm_device *imxdrm = imx_drm_crtc->crtc->dev->dev_private; struct imx_drm_device *imxdrm = imx_drm_crtc->crtc->dev->dev_private;
unsigned int pipe = drm_crtc_index(imx_drm_crtc->crtc);
drm_crtc_cleanup(imx_drm_crtc->crtc); drm_crtc_cleanup(imx_drm_crtc->crtc);
imxdrm->crtc[imx_drm_crtc->pipe] = NULL; imxdrm->crtc[pipe] = NULL;
kfree(imx_drm_crtc); kfree(imx_drm_crtc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册