aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_plane.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-02-13 07:00:42 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-03-01 02:18:18 -0500
commit50638ae569dc097a95218eb70140e68aa213b07c (patch)
treeee05794dd9530d70183c7e3f5d649e2a95940e12 /drivers/gpu/drm/omapdrm/omap_plane.c
parentd3541ca81dbddeefa0c42df448211a9dbaef0843 (diff)
drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operations
This removes the need to access the global DISPC private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DISPC private data dynamically). In order to allow the omapdrm side to call the dispc_ops with a DISPC pointer, we also introduce a new function dss_get_dispc() to retrieve the DISPC corresponding to the DSS. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_plane.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 0665ed9fe395..2899435cad6e 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -77,17 +77,17 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
77 &info.paddr, &info.p_uv_addr); 77 &info.paddr, &info.p_uv_addr);
78 78
79 /* and finally, update omapdss: */ 79 /* and finally, update omapdss: */
80 ret = priv->dispc_ops->ovl_setup(omap_plane->id, &info, 80 ret = priv->dispc_ops->ovl_setup(priv->dispc, omap_plane->id, &info,
81 omap_crtc_timings(state->crtc), false, 81 omap_crtc_timings(state->crtc), false,
82 omap_crtc_channel(state->crtc)); 82 omap_crtc_channel(state->crtc));
83 if (ret) { 83 if (ret) {
84 dev_err(plane->dev->dev, "Failed to setup plane %s\n", 84 dev_err(plane->dev->dev, "Failed to setup plane %s\n",
85 omap_plane->name); 85 omap_plane->name);
86 priv->dispc_ops->ovl_enable(omap_plane->id, false); 86 priv->dispc_ops->ovl_enable(priv->dispc, omap_plane->id, false);
87 return; 87 return;
88 } 88 }
89 89
90 priv->dispc_ops->ovl_enable(omap_plane->id, true); 90 priv->dispc_ops->ovl_enable(priv->dispc, omap_plane->id, true);
91} 91}
92 92
93static void omap_plane_atomic_disable(struct drm_plane *plane, 93static void omap_plane_atomic_disable(struct drm_plane *plane,
@@ -100,7 +100,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,
100 plane->state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY 100 plane->state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY
101 ? 0 : omap_plane->id; 101 ? 0 : omap_plane->id;
102 102
103 priv->dispc_ops->ovl_enable(omap_plane->id, false); 103 priv->dispc_ops->ovl_enable(priv->dispc, omap_plane->id, false);
104} 104}
105 105
106static int omap_plane_atomic_check(struct drm_plane *plane, 106static int omap_plane_atomic_check(struct drm_plane *plane,
@@ -259,7 +259,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
259 u32 possible_crtcs) 259 u32 possible_crtcs)
260{ 260{
261 struct omap_drm_private *priv = dev->dev_private; 261 struct omap_drm_private *priv = dev->dev_private;
262 unsigned int num_planes = priv->dispc_ops->get_num_ovls(); 262 unsigned int num_planes = priv->dispc_ops->get_num_ovls(priv->dispc);
263 struct drm_plane *plane; 263 struct drm_plane *plane;
264 struct omap_plane *omap_plane; 264 struct omap_plane *omap_plane;
265 enum omap_plane_id id; 265 enum omap_plane_id id;
@@ -278,7 +278,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
278 if (!omap_plane) 278 if (!omap_plane)
279 return ERR_PTR(-ENOMEM); 279 return ERR_PTR(-ENOMEM);
280 280
281 formats = priv->dispc_ops->ovl_get_color_modes(id); 281 formats = priv->dispc_ops->ovl_get_color_modes(priv->dispc, id);
282 for (nformats = 0; formats[nformats]; ++nformats) 282 for (nformats = 0; formats[nformats]; ++nformats)
283 ; 283 ;
284 omap_plane->id = id; 284 omap_plane->id = id;