drm/msm: add dirty framebuffer helper
authorBrian Masney <masneyb@onstation.org>
Fri, 31 May 2019 09:46:14 +0000 (05:46 -0400)
committerRob Clark <robdclark@chromium.org>
Tue, 25 Jun 2019 12:29:59 +0000 (05:29 -0700)
Use drm_atomic_helper_dirtyfb() as the dirty callback in the
msm_framebuffer_funcs struct. Call drm_plane_enable_fb_damage_clips()
when the planes are initialized in mdp4, mdp5, and dpu1.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
drivers/gpu/drm/msm/msm_fb.c

index 36c2b38805c3da4ba7c870cce3eb97e771218db8..ca658e11c6262e8f7c0dd7c37bd476b3e64494f2 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/debugfs.h>
 #include <linux/dma-buf.h>
 
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_atomic_uapi.h>
 
 #include "msm_drv.h"
@@ -1537,6 +1538,8 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
        if (ret)
                DPU_ERROR("failed to install zpos property, rc = %d\n", ret);
 
+       drm_plane_enable_fb_damage_clips(plane);
+
        /* success! finalize initialization */
        drm_plane_helper_add(plane, &dpu_plane_helper_funcs);
 
index 005066f7154d3cacc7aec43c884dd8991b35dc92..2d46d1126283be505aac093c95cd3acf33298b60 100644 (file)
@@ -15,6 +15,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <drm/drm_damage_helper.h>
 #include "mdp4_kms.h"
 
 #define DOWN_SCALE_MAX 8
@@ -391,6 +392,8 @@ struct drm_plane *mdp4_plane_init(struct drm_device *dev,
 
        mdp4_plane_install_properties(plane, &plane->base);
 
+       drm_plane_enable_fb_damage_clips(plane);
+
        return plane;
 
 fail:
index be13140967b4e8a294263ed2632673aee73368b0..fcb6d32c2b3848a0487773e597a740a0a816be1d 100644 (file)
@@ -16,6 +16,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_print.h>
 #include "mdp5_kms.h"
 
@@ -1099,6 +1100,8 @@ struct drm_plane *mdp5_plane_init(struct drm_device *dev,
 
        mdp5_plane_install_properties(plane, &plane->base);
 
+       drm_plane_enable_fb_damage_clips(plane);
+
        return plane;
 
 fail:
index 136058978e0fd095013ded524e18c839849a52e3..8624a8e4025f78a906d44c410eafc27e9d380a49 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <drm/drm_crtc.h>
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_probe_helper.h>
 
@@ -35,6 +36,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
 static const struct drm_framebuffer_funcs msm_framebuffer_funcs = {
        .create_handle = drm_gem_fb_create_handle,
        .destroy = drm_gem_fb_destroy,
+       .dirty = drm_atomic_helper_dirtyfb,
 };
 
 #ifdef CONFIG_DEBUG_FS