* [PATCH 1/2] drm/exynos: fimd: Remove drm_dev pointer from fimd_context
@ 2014-11-28 11:14 Ajay Kumar
2014-11-28 11:14 ` [PATCH 2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device Ajay Kumar
0 siblings, 1 reply; 3+ messages in thread
From: Ajay Kumar @ 2014-11-28 11:14 UTC (permalink / raw)
To: dri-devel, devicetree, linux-samsung-soc, inki.dae
Cc: jy0922.shim, jg1.han, seanpaul, ajaynumb, bhushan.r, prashanth.g,
Ajay Kumar
ctx->drm_dev is unnecessary since it can be easily
accessed via ctx->manager->drm_dev, cleaning it up.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index e5810d1..122c851 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -159,7 +159,6 @@ struct fimd_win_data {
struct fimd_context {
struct exynos_drm_manager manager;
struct device *dev;
- struct drm_device *drm_dev;
struct clk *bus_clk;
struct clk *lcd_clk;
void __iomem *regs;
@@ -298,17 +297,17 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
struct exynos_drm_private *priv;
priv = drm_dev->dev_private;
- mgr->drm_dev = ctx->drm_dev = drm_dev;
+ mgr->drm_dev = drm_dev;
mgr->pipe = ctx->pipe = priv->pipe++;
/* attach this sub driver to iommu mapping if supported. */
- if (is_drm_iommu_supported(ctx->drm_dev)) {
+ if (is_drm_iommu_supported(mgr->drm_dev)) {
/*
* If any channel is already active, iommu will throw
* a PAGE FAULT when enabled. So clear any channel if enabled.
*/
fimd_clear_channel(mgr);
- drm_iommu_attach_device(ctx->drm_dev, ctx->dev);
+ drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
}
return 0;
@@ -319,8 +318,8 @@ static void fimd_mgr_remove(struct exynos_drm_manager *mgr)
struct fimd_context *ctx = mgr_to_fimd(mgr);
/* detach this sub driver from iommu mapping if supported. */
- if (is_drm_iommu_supported(ctx->drm_dev))
- drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
+ if (is_drm_iommu_supported(mgr->drm_dev))
+ drm_iommu_detach_device(mgr->drm_dev, ctx->dev);
}
static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
@@ -1001,7 +1000,7 @@ static void fimd_te_handler(struct exynos_drm_manager *mgr)
struct fimd_context *ctx = mgr_to_fimd(mgr);
/* Checks the crtc is detached already from encoder */
- if (ctx->pipe < 0 || !ctx->drm_dev)
+ if (ctx->pipe < 0 || !mgr->drm_dev)
return;
/*
@@ -1018,7 +1017,7 @@ static void fimd_te_handler(struct exynos_drm_manager *mgr)
}
if (test_bit(0, &ctx->irq_flags))
- drm_handle_vblank(ctx->drm_dev, ctx->pipe);
+ drm_handle_vblank(mgr->drm_dev, ctx->pipe);
}
static struct exynos_drm_manager_ops fimd_manager_ops = {
@@ -1047,17 +1046,19 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
writel(clear_bit, ctx->regs + VIDINTCON1);
/* check the crtc is detached already from encoder */
- if (ctx->pipe < 0 || !ctx->drm_dev)
+ if (ctx->pipe < 0 || !ctx->manager.drm_dev)
goto out;
if (ctx->i80_if) {
- exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+ exynos_drm_crtc_finish_pageflip(ctx->manager.drm_dev,
+ ctx->pipe);
/* Exits triggering mode */
atomic_set(&ctx->triggering, 0);
} else {
- drm_handle_vblank(ctx->drm_dev, ctx->pipe);
- exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+ drm_handle_vblank(ctx->manager.drm_dev, ctx->pipe);
+ exynos_drm_crtc_finish_pageflip(ctx->manager.drm_dev,
+ ctx->pipe);
/* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device
2014-11-28 11:14 [PATCH 1/2] drm/exynos: fimd: Remove drm_dev pointer from fimd_context Ajay Kumar
@ 2014-11-28 11:14 ` Ajay Kumar
0 siblings, 0 replies; 3+ messages in thread
From: Ajay Kumar @ 2014-11-28 11:14 UTC (permalink / raw)
To: dri-devel, devicetree, linux-samsung-soc, inki.dae
Cc: jy0922.shim, jg1.han, seanpaul, ajaynumb, bhushan.r, prashanth.g,
Ajay Kumar
check error status for drm_iommu_attach_device() and make sure
it propagates till the caller.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 122c851..528420c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -295,6 +295,8 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
{
struct fimd_context *ctx = mgr_to_fimd(mgr);
struct exynos_drm_private *priv;
+ int ret;
+
priv = drm_dev->dev_private;
mgr->drm_dev = drm_dev;
@@ -307,7 +309,12 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
* a PAGE FAULT when enabled. So clear any channel if enabled.
*/
fimd_clear_channel(mgr);
- drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
+
+ ret = drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
+ if (ret) {
+ DRM_ERROR("drm_iommu_attach failed.\n");
+ return ret;
+ }
}
return 0;
@@ -1075,8 +1082,14 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
{
struct fimd_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
+ int ret;
+
+ ret = fimd_mgr_initialize(&ctx->manager, drm_dev);
+ if (ret) {
+ DRM_ERROR("fimd_mgr_initialize failed.\n");
+ return ret;
+ }
- fimd_mgr_initialize(&ctx->manager, drm_dev);
exynos_drm_crtc_create(&ctx->manager);
if (ctx->display)
exynos_drm_create_enc_conn(drm_dev, ctx->display);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/2] drm/exynos: fimd: Remove drm_dev and pipe members from fimd_context
@ 2014-12-07 12:04 Ajay Kumar
2014-12-07 12:04 ` [PATCH 2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device Ajay Kumar
0 siblings, 1 reply; 3+ messages in thread
From: Ajay Kumar @ 2014-12-07 12:04 UTC (permalink / raw)
To: dri-devel, devicetree, linux-samsung-soc, inki.dae
Cc: jy0922.shim, jg1.han, seanpaul, ajaynumb, bhushan.r, prashanth.g,
Ajay Kumar
ctx->drm_dev is unnecessary since it can be easily accessed
via ctx->manager->drm_dev. Even the pipe variable inside
fimd_context is redundant. Cleaning up the same.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index e5810d1..157f4dd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -159,7 +159,6 @@ struct fimd_win_data {
struct fimd_context {
struct exynos_drm_manager manager;
struct device *dev;
- struct drm_device *drm_dev;
struct clk *bus_clk;
struct clk *lcd_clk;
void __iomem *regs;
@@ -174,7 +173,6 @@ struct fimd_context {
u32 i80ifcon;
bool i80_if;
bool suspended;
- int pipe;
wait_queue_head_t wait_vsync_queue;
atomic_t wait_vsync_event;
atomic_t win_updated;
@@ -298,17 +296,17 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
struct exynos_drm_private *priv;
priv = drm_dev->dev_private;
- mgr->drm_dev = ctx->drm_dev = drm_dev;
- mgr->pipe = ctx->pipe = priv->pipe++;
+ mgr->drm_dev = drm_dev;
+ mgr->pipe = priv->pipe++;
/* attach this sub driver to iommu mapping if supported. */
- if (is_drm_iommu_supported(ctx->drm_dev)) {
+ if (is_drm_iommu_supported(mgr->drm_dev)) {
/*
* If any channel is already active, iommu will throw
* a PAGE FAULT when enabled. So clear any channel if enabled.
*/
fimd_clear_channel(mgr);
- drm_iommu_attach_device(ctx->drm_dev, ctx->dev);
+ drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
}
return 0;
@@ -319,8 +317,8 @@ static void fimd_mgr_remove(struct exynos_drm_manager *mgr)
struct fimd_context *ctx = mgr_to_fimd(mgr);
/* detach this sub driver from iommu mapping if supported. */
- if (is_drm_iommu_supported(ctx->drm_dev))
- drm_iommu_detach_device(ctx->drm_dev, ctx->dev);
+ if (is_drm_iommu_supported(mgr->drm_dev))
+ drm_iommu_detach_device(mgr->drm_dev, ctx->dev);
}
static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
@@ -1001,7 +999,7 @@ static void fimd_te_handler(struct exynos_drm_manager *mgr)
struct fimd_context *ctx = mgr_to_fimd(mgr);
/* Checks the crtc is detached already from encoder */
- if (ctx->pipe < 0 || !ctx->drm_dev)
+ if (mgr->pipe < 0 || !mgr->drm_dev)
return;
/*
@@ -1018,7 +1016,7 @@ static void fimd_te_handler(struct exynos_drm_manager *mgr)
}
if (test_bit(0, &ctx->irq_flags))
- drm_handle_vblank(ctx->drm_dev, ctx->pipe);
+ drm_handle_vblank(mgr->drm_dev, mgr->pipe);
}
static struct exynos_drm_manager_ops fimd_manager_ops = {
@@ -1047,17 +1045,19 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
writel(clear_bit, ctx->regs + VIDINTCON1);
/* check the crtc is detached already from encoder */
- if (ctx->pipe < 0 || !ctx->drm_dev)
+ if (ctx->manager.pipe < 0 || !ctx->manager.drm_dev)
goto out;
if (ctx->i80_if) {
- exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+ exynos_drm_crtc_finish_pageflip(ctx->manager.drm_dev,
+ ctx->manager.pipe);
/* Exits triggering mode */
atomic_set(&ctx->triggering, 0);
} else {
- drm_handle_vblank(ctx->drm_dev, ctx->pipe);
- exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe);
+ drm_handle_vblank(ctx->manager.drm_dev, ctx->manager.pipe);
+ exynos_drm_crtc_finish_pageflip(ctx->manager.drm_dev,
+ ctx->manager.pipe);
/* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device
2014-12-07 12:04 [PATCH 1/2] drm/exynos: fimd: Remove drm_dev and pipe members from fimd_context Ajay Kumar
@ 2014-12-07 12:04 ` Ajay Kumar
0 siblings, 0 replies; 3+ messages in thread
From: Ajay Kumar @ 2014-12-07 12:04 UTC (permalink / raw)
To: dri-devel, devicetree, linux-samsung-soc, inki.dae
Cc: jy0922.shim, jg1.han, seanpaul, ajaynumb, bhushan.r, prashanth.g,
Ajay Kumar
check error status for drm_iommu_attach_device() and make sure
it propagates till the caller.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 157f4dd..a53d35b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -294,6 +294,8 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
{
struct fimd_context *ctx = mgr_to_fimd(mgr);
struct exynos_drm_private *priv;
+ int ret;
+
priv = drm_dev->dev_private;
mgr->drm_dev = drm_dev;
@@ -306,7 +308,12 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
* a PAGE FAULT when enabled. So clear any channel if enabled.
*/
fimd_clear_channel(mgr);
- drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
+
+ ret = drm_iommu_attach_device(mgr->drm_dev, ctx->dev);
+ if (ret) {
+ DRM_ERROR("drm_iommu_attach failed.\n");
+ return ret;
+ }
}
return 0;
@@ -1074,8 +1081,14 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
{
struct fimd_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
+ int ret;
+
+ ret = fimd_mgr_initialize(&ctx->manager, drm_dev);
+ if (ret) {
+ DRM_ERROR("fimd_mgr_initialize failed.\n");
+ return ret;
+ }
- fimd_mgr_initialize(&ctx->manager, drm_dev);
exynos_drm_crtc_create(&ctx->manager);
if (ctx->display)
exynos_drm_create_enc_conn(drm_dev, ctx->display);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-07 12:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28 11:14 [PATCH 1/2] drm/exynos: fimd: Remove drm_dev pointer from fimd_context Ajay Kumar
2014-11-28 11:14 ` [PATCH 2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device Ajay Kumar
-- strict thread matches above, loose matches on Subject: below --
2014-12-07 12:04 [PATCH 1/2] drm/exynos: fimd: Remove drm_dev and pipe members from fimd_context Ajay Kumar
2014-12-07 12:04 ` [PATCH 2/2] drm/exynos: fimd: check error status for drm_iommu_attach_device Ajay Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).