hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/gpu/drm/omapdrm/omap_plane.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
34 * Author: Rob Clark <rob.clark@linaro.org>
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 <drm/drm_atomic.h>
....@@ -64,8 +53,12 @@
6453 memset(&info, 0, sizeof(info));
6554 info.rotation_type = OMAP_DSS_ROT_NONE;
6655 info.rotation = DRM_MODE_ROTATE_0;
67
- info.global_alpha = 0xff;
56
+ info.global_alpha = state->alpha >> 8;
6857 info.zorder = state->normalized_zpos;
58
+ if (state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI)
59
+ info.pre_mult_alpha = 1;
60
+ else
61
+ info.pre_mult_alpha = 0;
6962
7063 /* update scanout: */
7164 omap_framebuffer_update_scanout(state->fb, state, &info);
....@@ -296,6 +289,9 @@
296289
297290 omap_plane_install_properties(plane, &plane->base);
298291 drm_plane_create_zpos_property(plane, 0, 0, num_planes - 1);
292
+ drm_plane_create_alpha_property(plane);
293
+ drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PREMULTI) |
294
+ BIT(DRM_MODE_BLEND_COVERAGE));
299295
300296 return plane;
301297