Re: [PATCH 2/6] drm: kirin: use crtc helper drm_crtc_from_index()

2017-01-18 Thread Sean Paul
On Mon, Jan 9, 2017 at 8:21 PM, liuxinliang  wrote:
>
>
> On 2017/1/9 19:25, Shawn Guo wrote:
>>
>> Signed-off-by: Shawn Guo
>> Cc: Xinliang Liu
>
> Thanks Shawn Guo,
>
> Reviewed-by: Xinliang Liu
>


Applied to drm-misc-next

Thanks!

Sean

>
> -xinliang
>
>
>
>



-- 
Sean Paul, Software Engineer, Google / Chromium OS
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/6] drm: kirin: use crtc helper drm_crtc_from_index()

2017-01-10 Thread liuxinliang


On 2017/1/9 19:25, Shawn Guo wrote:
> Signed-off-by: Shawn Guo
> Cc: Xinliang Liu
Thanks Shawn Guo,

Reviewed-by: Xinliang Liu


-xinliang






[PATCH 2/6] drm: kirin: use crtc helper drm_crtc_from_index()

2017-01-09 Thread Shawn Guo
From: Shawn Guo 

Use drm_crtc_from_index() to find drm_crtc for given index, so that we
do not need to maintain a pointer array in struct kirin_drm_private.

Signed-off-by: Shawn Guo 
Cc: Xinliang Liu 
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 --
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h |  1 -
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index afc2b5d2d5f0..29d8d1cf109d 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -304,8 +304,8 @@ static void ade_set_medianoc_qos(struct ade_crtc *acrtc)

 static int ade_enable_vblank(struct drm_device *dev, unsigned int pipe)
 {
-   struct kirin_drm_private *priv = dev->dev_private;
-   struct ade_crtc *acrtc = to_ade_crtc(priv->crtc[pipe]);
+   struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+   struct ade_crtc *acrtc = to_ade_crtc(crtc);
struct ade_hw_ctx *ctx = acrtc->ctx;
void __iomem *base = ctx->base;

@@ -320,8 +320,8 @@ static int ade_enable_vblank(struct drm_device *dev, 
unsigned int pipe)

 static void ade_disable_vblank(struct drm_device *dev, unsigned int pipe)
 {
-   struct kirin_drm_private *priv = dev->dev_private;
-   struct ade_crtc *acrtc = to_ade_crtc(priv->crtc[pipe]);
+   struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe);
+   struct ade_crtc *acrtc = to_ade_crtc(crtc);
struct ade_hw_ctx *ctx = acrtc->ctx;
void __iomem *base = ctx->base;

@@ -575,7 +575,6 @@ static void ade_crtc_atomic_flush(struct drm_crtc *crtc,
 static int ade_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
 struct drm_plane *plane)
 {
-   struct kirin_drm_private *priv = dev->dev_private;
struct device_node *port;
int ret;

@@ -599,7 +598,6 @@ static int ade_crtc_init(struct drm_device *dev, struct 
drm_crtc *crtc,
}

drm_crtc_helper_add(crtc, _crtc_helper_funcs);
-   priv->crtc[drm_crtc_index(crtc)] = crtc;

return 0;
 }
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
index 1a07caf8e7f4..c6453b24d612 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
@@ -20,7 +20,6 @@ struct kirin_dc_ops {
 };

 struct kirin_drm_private {
-   struct drm_crtc *crtc[MAX_CRTC];
 #ifdef CONFIG_DRM_FBDEV_EMULATION
struct drm_fbdev_cma *fbdev;
 #endif
-- 
1.9.1