| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * rcar_du_plane.c -- R-Car Display Unit Planes |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2013-2015 Renesas Electronics Corporation |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | | -#include <drm/drmP.h> |
|---|
| 15 | 10 | #include <drm/drm_atomic.h> |
|---|
| 16 | 11 | #include <drm/drm_atomic_helper.h> |
|---|
| 17 | 12 | #include <drm/drm_crtc.h> |
|---|
| 18 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 13 | +#include <drm/drm_device.h> |
|---|
| 19 | 14 | #include <drm/drm_fb_cma_helper.h> |
|---|
| 15 | +#include <drm/drm_fourcc.h> |
|---|
| 20 | 16 | #include <drm/drm_gem_cma_helper.h> |
|---|
| 21 | 17 | #include <drm/drm_plane_helper.h> |
|---|
| 22 | 18 | |
|---|
| .. | .. |
|---|
| 690 | 686 | if (state == NULL) |
|---|
| 691 | 687 | return; |
|---|
| 692 | 688 | |
|---|
| 689 | + __drm_atomic_helper_plane_reset(plane, &state->state); |
|---|
| 690 | + |
|---|
| 693 | 691 | state->hwindex = -1; |
|---|
| 694 | 692 | state->source = RCAR_DU_PLANE_MEMORY; |
|---|
| 695 | 693 | state->colorkey = RCAR_DU_COLORKEY_NONE; |
|---|
| 696 | 694 | state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; |
|---|
| 697 | | - |
|---|
| 698 | | - plane->state = &state->state; |
|---|
| 699 | | - plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE; |
|---|
| 700 | | - plane->state->plane = plane; |
|---|
| 701 | 695 | } |
|---|
| 702 | 696 | |
|---|
| 703 | 697 | static int rcar_du_plane_atomic_set_property(struct drm_plane *plane, |
|---|
| .. | .. |
|---|
| 789 | 783 | drm_plane_helper_add(&plane->plane, |
|---|
| 790 | 784 | &rcar_du_plane_helper_funcs); |
|---|
| 791 | 785 | |
|---|
| 792 | | - if (type == DRM_PLANE_TYPE_PRIMARY) |
|---|
| 793 | | - continue; |
|---|
| 794 | | - |
|---|
| 795 | | - drm_object_attach_property(&plane->plane.base, |
|---|
| 796 | | - rcdu->props.colorkey, |
|---|
| 797 | | - RCAR_DU_COLORKEY_NONE); |
|---|
| 798 | 786 | drm_plane_create_alpha_property(&plane->plane); |
|---|
| 799 | | - drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); |
|---|
| 787 | + |
|---|
| 788 | + if (type == DRM_PLANE_TYPE_PRIMARY) { |
|---|
| 789 | + drm_plane_create_zpos_immutable_property(&plane->plane, |
|---|
| 790 | + 0); |
|---|
| 791 | + } else { |
|---|
| 792 | + drm_object_attach_property(&plane->plane.base, |
|---|
| 793 | + rcdu->props.colorkey, |
|---|
| 794 | + RCAR_DU_COLORKEY_NONE); |
|---|
| 795 | + drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); |
|---|
| 796 | + } |
|---|
| 800 | 797 | } |
|---|
| 801 | 798 | |
|---|
| 802 | 799 | return 0; |
|---|