.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2016 Red Hat |
---|
3 | 4 | * 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/>. |
---|
16 | 5 | */ |
---|
17 | 6 | |
---|
18 | 7 | #include "mdp5_kms.h" |
---|
.. | .. |
---|
130 | 119 | return 0; |
---|
131 | 120 | } |
---|
132 | 121 | |
---|
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) |
---|
134 | 123 | { |
---|
135 | 124 | struct msm_drm_private *priv = s->dev->dev_private; |
---|
136 | 125 | 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; |
---|
139 | 128 | |
---|
140 | 129 | 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; |
---|
142 | 137 | |
---|
143 | 138 | if (WARN_ON(!new_state->hwpipe_to_plane[hwpipe->idx])) |
---|
144 | | - return; |
---|
| 139 | + return -EINVAL; |
---|
145 | 140 | |
---|
146 | 141 | DBG("%s: release from plane %s", hwpipe->name, |
---|
147 | 142 | new_state->hwpipe_to_plane[hwpipe->idx]->name); |
---|
.. | .. |
---|
152 | 147 | } |
---|
153 | 148 | |
---|
154 | 149 | new_state->hwpipe_to_plane[hwpipe->idx] = NULL; |
---|
| 150 | + |
---|
| 151 | + return 0; |
---|
155 | 152 | } |
---|
156 | 153 | |
---|
157 | 154 | void mdp5_pipe_destroy(struct mdp5_hw_pipe *hwpipe) |
---|