Skip to content

Commit b46355f

Browse files
Shawn Guogregkh
authored andcommitted
imx-drm: ipuv3-plane: remove function ipu_plane_dpms()
All those ipu_*_put() calls in ipu_plane_dpms() are unnecessary, because the only occurrence of ipu_plane_dpms() with 'mode' not being DRM_MODE_DPMS_ON is in function ipu_disable_plane(), which already has a ipu_plane_put_resources() call to put those ipu resources right after ipu_plane_dpms(). So with those redundant ipu_*_put() calls removed from ipu_plane_dpms(), the only left code in the function is ipu_plane_enable|disable(). Thus, we can just call ipu_plane_enable|disable() as needed directly and remove the ipu_plane_dpms() function completely. Suggested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 13e55e4 commit b46355f

1 file changed

Lines changed: 4 additions & 25 deletions

File tree

‎drivers/staging/imx-drm/ipuv3-plane.c‎

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -259,29 +259,6 @@ void ipu_plane_disable(struct ipu_plane *ipu_plane)
259259
ipu_dp_disable(ipu_plane->ipu);
260260
}
261261

262-
static void ipu_plane_dpms(struct ipu_plane *ipu_plane, int mode)
263-
{
264-
bool enable;
265-
266-
DRM_DEBUG_KMS("mode = %d", mode);
267-
268-
enable = (mode == DRM_MODE_DPMS_ON);
269-
270-
if (enable == ipu_plane->enabled)
271-
return;
272-
273-
if (enable) {
274-
ipu_plane_enable(ipu_plane);
275-
} else {
276-
ipu_plane_disable(ipu_plane);
277-
278-
ipu_idmac_put(ipu_plane->ipu_ch);
279-
ipu_dmfc_put(ipu_plane->dmfc);
280-
if (ipu_plane->dp)
281-
ipu_dp_put(ipu_plane->dp);
282-
}
283-
}
284-
285262
/*
286263
* drm_plane API
287264
*/
@@ -315,7 +292,8 @@ static int ipu_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
315292
plane->crtc, crtc);
316293
plane->crtc = crtc;
317294

318-
ipu_plane_dpms(ipu_plane, DRM_MODE_DPMS_ON);
295+
if (!ipu_plane->enabled)
296+
ipu_plane_enable(ipu_plane);
319297

320298
return 0;
321299
}
@@ -326,7 +304,8 @@ static int ipu_disable_plane(struct drm_plane *plane)
326304

327305
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
328306

329-
ipu_plane_dpms(ipu_plane, DRM_MODE_DPMS_OFF);
307+
if (ipu_plane->enabled)
308+
ipu_plane_disable(ipu_plane);
330309

331310
ipu_plane_put_resources(ipu_plane);
332311

0 commit comments

Comments
 (0)