| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
|---|
| 3 | 4 | * 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/>. |
|---|
| 16 | 5 | */ |
|---|
| 17 | 6 | |
|---|
| 18 | 7 | #include <drm/drm_atomic.h> |
|---|
| .. | .. |
|---|
| 64 | 53 | memset(&info, 0, sizeof(info)); |
|---|
| 65 | 54 | info.rotation_type = OMAP_DSS_ROT_NONE; |
|---|
| 66 | 55 | info.rotation = DRM_MODE_ROTATE_0; |
|---|
| 67 | | - info.global_alpha = 0xff; |
|---|
| 56 | + info.global_alpha = state->alpha >> 8; |
|---|
| 68 | 57 | 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; |
|---|
| 69 | 62 | |
|---|
| 70 | 63 | /* update scanout: */ |
|---|
| 71 | 64 | omap_framebuffer_update_scanout(state->fb, state, &info); |
|---|
| .. | .. |
|---|
| 296 | 289 | |
|---|
| 297 | 290 | omap_plane_install_properties(plane, &plane->base); |
|---|
| 298 | 291 | 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)); |
|---|
| 299 | 295 | |
|---|
| 300 | 296 | return plane; |
|---|
| 301 | 297 | |
|---|