forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
....@@ -1,19 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2013 Red Hat
34 * Author: Rob Clark <robdclark@gmail.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License version 2 as published by
7
- * the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program. If not, see <http://www.gnu.org/licenses/>.
165 */
6
+
7
+#include <drm/drm_damage_helper.h>
8
+#include <drm/drm_fourcc.h>
179
1810 #include "mdp4_kms.h"
1911
....@@ -68,7 +60,6 @@
6860 {
6961 struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane);
7062
71
- drm_plane_helper_disable(plane, NULL);
7263 drm_plane_cleanup(plane);
7364
7465 kfree(mdp4_plane);
....@@ -235,22 +226,22 @@
235226 format = to_mdp_format(msm_framebuffer_format(fb));
236227
237228 if (src_w > (crtc_w * DOWN_SCALE_MAX)) {
238
- dev_err(dev->dev, "Width down scaling exceeds limits!\n");
229
+ DRM_DEV_ERROR(dev->dev, "Width down scaling exceeds limits!\n");
239230 return -ERANGE;
240231 }
241232
242233 if (src_h > (crtc_h * DOWN_SCALE_MAX)) {
243
- dev_err(dev->dev, "Height down scaling exceeds limits!\n");
234
+ DRM_DEV_ERROR(dev->dev, "Height down scaling exceeds limits!\n");
244235 return -ERANGE;
245236 }
246237
247238 if (crtc_w > (src_w * UP_SCALE_MAX)) {
248
- dev_err(dev->dev, "Width up scaling exceeds limits!\n");
239
+ DRM_DEV_ERROR(dev->dev, "Width up scaling exceeds limits!\n");
249240 return -ERANGE;
250241 }
251242
252243 if (crtc_h > (src_h * UP_SCALE_MAX)) {
253
- dev_err(dev->dev, "Height up scaling exceeds limits!\n");
244
+ DRM_DEV_ERROR(dev->dev, "Height up scaling exceeds limits!\n");
254245 return -ERANGE;
255246 }
256247
....@@ -398,6 +389,8 @@
398389
399390 mdp4_plane_install_properties(plane, &plane->base);
400391
392
+ drm_plane_enable_fb_damage_clips(plane);
393
+
401394 return plane;
402395
403396 fail: