.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 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/>. |
---|
15 | 4 | */ |
---|
16 | 5 | |
---|
17 | 6 | #include "mdp5_kms.h" |
---|
.. | .. |
---|
127 | 116 | return 0; |
---|
128 | 117 | } |
---|
129 | 118 | |
---|
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) |
---|
131 | 120 | { |
---|
132 | 121 | 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; |
---|
134 | 123 | |
---|
135 | 124 | 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; |
---|
137 | 131 | |
---|
138 | 132 | if (WARN_ON(!new_state->hwmixer_to_crtc[mixer->idx])) |
---|
139 | | - return; |
---|
| 133 | + return -EINVAL; |
---|
140 | 134 | |
---|
141 | 135 | DBG("%s: release from crtc %s", mixer->name, |
---|
142 | 136 | new_state->hwmixer_to_crtc[mixer->idx]->name); |
---|
143 | 137 | |
---|
144 | 138 | new_state->hwmixer_to_crtc[mixer->idx] = NULL; |
---|
| 139 | + |
---|
| 140 | + return 0; |
---|
145 | 141 | } |
---|
146 | 142 | |
---|
147 | 143 | void mdp5_mixer_destroy(struct mdp5_hw_mixer *mixer) |
---|