hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/gpu/drm/tilcdc/tilcdc_plane.c
....@@ -1,30 +1,17 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2015 Texas Instruments
34 * Author: Jyri Sarha <jsarha@ti.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 */
17
-
18
-#include <drm/drmP.h>
196
207 #include <drm/drm_atomic.h>
218 #include <drm/drm_plane_helper.h>
229 #include <drm/drm_atomic_helper.h>
23
-#include <uapi/drm/drm_fourcc.h>
10
+#include <drm/drm_fourcc.h>
2411
2512 #include "tilcdc_drv.h"
2613
27
-static struct drm_plane_funcs tilcdc_plane_funcs = {
14
+static const struct drm_plane_funcs tilcdc_plane_funcs = {
2815 .update_plane = drm_atomic_helper_update_plane,
2916 .disable_plane = drm_atomic_helper_disable_plane,
3017 .destroy = drm_plane_cleanup,
....@@ -75,8 +62,7 @@
7562 return -EINVAL;
7663 }
7764
78
- if (state->fb && old_state->fb &&
79
- state->fb->format != old_state->fb->format) {
65
+ if (old_state->fb && state->fb->format != old_state->fb->format) {
8066 dev_dbg(plane->dev->dev,
8167 "%s(): pixel format change requires mode_change\n",
8268 __func__);
....@@ -97,9 +83,11 @@
9783 if (WARN_ON(!state->fb || !state->crtc->state))
9884 return;
9985
100
- tilcdc_crtc_update_fb(state->crtc,
101
- state->fb,
102
- state->crtc->state->event);
86
+ if (tilcdc_crtc_update_fb(state->crtc,
87
+ state->fb,
88
+ state->crtc->state->event) == 0) {
89
+ state->crtc->state->event = NULL;
90
+ }
10391 }
10492
10593 static const struct drm_plane_helper_funcs plane_helper_funcs = {