| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2015 Texas Instruments |
|---|
| 3 | 4 | * 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/>. |
|---|
| 16 | 5 | */ |
|---|
| 17 | | - |
|---|
| 18 | | -#include <drm/drmP.h> |
|---|
| 19 | 6 | |
|---|
| 20 | 7 | #include <drm/drm_atomic.h> |
|---|
| 21 | 8 | #include <drm/drm_plane_helper.h> |
|---|
| 22 | 9 | #include <drm/drm_atomic_helper.h> |
|---|
| 23 | | -#include <uapi/drm/drm_fourcc.h> |
|---|
| 10 | +#include <drm/drm_fourcc.h> |
|---|
| 24 | 11 | |
|---|
| 25 | 12 | #include "tilcdc_drv.h" |
|---|
| 26 | 13 | |
|---|
| 27 | | -static struct drm_plane_funcs tilcdc_plane_funcs = { |
|---|
| 14 | +static const struct drm_plane_funcs tilcdc_plane_funcs = { |
|---|
| 28 | 15 | .update_plane = drm_atomic_helper_update_plane, |
|---|
| 29 | 16 | .disable_plane = drm_atomic_helper_disable_plane, |
|---|
| 30 | 17 | .destroy = drm_plane_cleanup, |
|---|
| .. | .. |
|---|
| 75 | 62 | return -EINVAL; |
|---|
| 76 | 63 | } |
|---|
| 77 | 64 | |
|---|
| 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) { |
|---|
| 80 | 66 | dev_dbg(plane->dev->dev, |
|---|
| 81 | 67 | "%s(): pixel format change requires mode_change\n", |
|---|
| 82 | 68 | __func__); |
|---|
| .. | .. |
|---|
| 97 | 83 | if (WARN_ON(!state->fb || !state->crtc->state)) |
|---|
| 98 | 84 | return; |
|---|
| 99 | 85 | |
|---|
| 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 | + } |
|---|
| 103 | 91 | } |
|---|
| 104 | 92 | |
|---|
| 105 | 93 | static const struct drm_plane_helper_funcs plane_helper_funcs = { |
|---|