hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/gpu/drm/msm/disp/mdp5/mdp5_pipe.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2016 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 */
176
187 #include "mdp5_kms.h"
....@@ -130,18 +119,24 @@
130119 return 0;
131120 }
132121
133
-void mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)
122
+int mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe)
134123 {
135124 struct msm_drm_private *priv = s->dev->dev_private;
136125 struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(priv->kms));
137
- struct mdp5_global_state *state = mdp5_get_global_state(s);
138
- struct mdp5_hw_pipe_state *new_state = &state->hwpipe;
126
+ struct mdp5_global_state *state;
127
+ struct mdp5_hw_pipe_state *new_state;
139128
140129 if (!hwpipe)
141
- return;
130
+ return 0;
131
+
132
+ state = mdp5_get_global_state(s);
133
+ if (IS_ERR(state))
134
+ return PTR_ERR(state);
135
+
136
+ new_state = &state->hwpipe;
142137
143138 if (WARN_ON(!new_state->hwpipe_to_plane[hwpipe->idx]))
144
- return;
139
+ return -EINVAL;
145140
146141 DBG("%s: release from plane %s", hwpipe->name,
147142 new_state->hwpipe_to_plane[hwpipe->idx]->name);
....@@ -152,6 +147,8 @@
152147 }
153148
154149 new_state->hwpipe_to_plane[hwpipe->idx] = NULL;
150
+
151
+ return 0;
155152 }
156153
157154 void mdp5_pipe_destroy(struct mdp5_hw_pipe *hwpipe)