forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/msm/disp/mdp5/mdp5_mixer.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2017 The Linux Foundation. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms of the GNU General Public License version 2 as published by
6
- * the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165
176 #include "mdp5_kms.h"
....@@ -127,21 +116,28 @@
127116 return 0;
128117 }
129118
130
-void mdp5_mixer_release(struct drm_atomic_state *s, struct mdp5_hw_mixer *mixer)
119
+int mdp5_mixer_release(struct drm_atomic_state *s, struct mdp5_hw_mixer *mixer)
131120 {
132121 struct mdp5_global_state *global_state = mdp5_get_global_state(s);
133
- struct mdp5_hw_mixer_state *new_state = &global_state->hwmixer;
122
+ struct mdp5_hw_mixer_state *new_state;
134123
135124 if (!mixer)
136
- return;
125
+ return 0;
126
+
127
+ if (IS_ERR(global_state))
128
+ return PTR_ERR(global_state);
129
+
130
+ new_state = &global_state->hwmixer;
137131
138132 if (WARN_ON(!new_state->hwmixer_to_crtc[mixer->idx]))
139
- return;
133
+ return -EINVAL;
140134
141135 DBG("%s: release from crtc %s", mixer->name,
142136 new_state->hwmixer_to_crtc[mixer->idx]->name);
143137
144138 new_state->hwmixer_to_crtc[mixer->idx] = NULL;
139
+
140
+ return 0;
145141 }
146142
147143 void mdp5_mixer_destroy(struct mdp5_hw_mixer *mixer)