mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
drm/rockchip: vop2: No limit possible_crtc
Change-Id: Iaa297f9077ff2f3a12ef256dcac31dc2bec1c274 Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This commit is contained in:
@@ -640,7 +640,6 @@ struct vop2_win_data {
|
||||
const uint32_t *formats;
|
||||
const uint64_t *format_modifiers;
|
||||
const unsigned int supported_rotations;
|
||||
uint32_t possible_crtcs[VOP2_SOC_VARIANT];
|
||||
|
||||
const struct vop2_win_regs *regs;
|
||||
const struct vop2_win_regs **area;
|
||||
|
||||
@@ -295,10 +295,6 @@ struct vop2_win {
|
||||
* one win can only attach to one vp at the one time.
|
||||
*/
|
||||
uint8_t vp_mask;
|
||||
/*
|
||||
* @possible_crtcs: which crtc/vp this win can attached to.
|
||||
*/
|
||||
uint32_t possible_crtcs;
|
||||
uint8_t zpos;
|
||||
uint32_t offset;
|
||||
enum drm_plane_type type;
|
||||
@@ -5131,7 +5127,7 @@ static int vop2_plane_create_feature_property(struct vop2 *vop2, struct vop2_win
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vop2_plane_init(struct vop2 *vop2, struct vop2_win *win)
|
||||
static int vop2_plane_init(struct vop2 *vop2, struct vop2_win *win, unsigned long possible_crtcs)
|
||||
{
|
||||
struct rockchip_drm_private *private = vop2->drm_dev->dev_private;
|
||||
unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_PREMULTI) |
|
||||
@@ -5139,7 +5135,7 @@ static int vop2_plane_init(struct vop2 *vop2, struct vop2_win *win)
|
||||
unsigned int max_width, max_height;
|
||||
int ret;
|
||||
|
||||
ret = drm_universal_plane_init(vop2->drm_dev, &win->base, win->possible_crtcs,
|
||||
ret = drm_universal_plane_init(vop2->drm_dev, &win->base, possible_crtcs,
|
||||
&vop2_plane_funcs, win->formats, win->nformats,
|
||||
win->format_modifiers, win->type, win->name);
|
||||
if (ret) {
|
||||
@@ -5269,11 +5265,15 @@ static int vop2_create_crtc(struct vop2 *vop2)
|
||||
struct vop2_win *win = NULL;
|
||||
struct vop2_video_port *vp;
|
||||
const struct vop2_video_port_data *vp_data;
|
||||
uint32_t possible_crtcs;
|
||||
uint64_t soc_id;
|
||||
char dclk_name[9];
|
||||
int i = 0, j = 0;
|
||||
int ret = 0;
|
||||
|
||||
/* all planes can attach to any crtc */
|
||||
possible_crtcs = (1 << vop2_data->nr_vps) - 1;
|
||||
|
||||
/*
|
||||
* Create primary plane for eache crtc first, since we need
|
||||
* to pass them to drm_crtc_init_with_planes, which sets the
|
||||
@@ -5313,7 +5313,7 @@ static int vop2_create_crtc(struct vop2 *vop2)
|
||||
break;
|
||||
}
|
||||
|
||||
if (vop2_plane_init(vop2, win)) {
|
||||
if (vop2_plane_init(vop2, win, possible_crtcs)) {
|
||||
DRM_DEV_ERROR(vop2->dev, "failed to init plane\n");
|
||||
break;
|
||||
}
|
||||
@@ -5372,7 +5372,7 @@ static int vop2_create_crtc(struct vop2 *vop2)
|
||||
if (win->type != DRM_PLANE_TYPE_OVERLAY)
|
||||
continue;
|
||||
|
||||
ret = vop2_plane_init(vop2, win);
|
||||
ret = vop2_plane_init(vop2, win, possible_crtcs);
|
||||
if (ret) {
|
||||
DRM_DEV_ERROR(vop2->dev, "failed to init overlay\n");
|
||||
break;
|
||||
@@ -5436,10 +5436,6 @@ static int vop2_win_init(struct vop2 *vop2)
|
||||
win->area_id = 0;
|
||||
win->zpos = i;
|
||||
win->vop2 = vop2;
|
||||
if (vop2_soc_is_rk3566())
|
||||
win->possible_crtcs = win_data->possible_crtcs[1];
|
||||
else
|
||||
win->possible_crtcs = win_data->possible_crtcs[0];
|
||||
|
||||
num_wins++;
|
||||
|
||||
@@ -5457,7 +5453,6 @@ static int vop2_win_init(struct vop2 *vop2)
|
||||
area->formats = win->formats;
|
||||
area->nformats = win->nformats;
|
||||
area->format_modifiers = win->format_modifiers;
|
||||
area->possible_crtcs = win->possible_crtcs;
|
||||
area->max_upscale_factor = win_data->max_upscale_factor;
|
||||
area->max_downscale_factor = win_data->max_downscale_factor;
|
||||
area->supported_rotations = win_data->supported_rotations;
|
||||
|
||||
@@ -974,8 +974,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.formats = formats_win_full_10bit,
|
||||
.nformats = ARRAY_SIZE(formats_win_full_10bit),
|
||||
.format_modifiers = format_modifiers_afbc,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x2 },
|
||||
.layer_sel_id = 0,
|
||||
.supported_rotations = DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270 |
|
||||
DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
|
||||
@@ -999,8 +997,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.formats = formats_win_full_10bit,
|
||||
.nformats = ARRAY_SIZE(formats_win_full_10bit),
|
||||
.format_modifiers = format_modifiers_afbc,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x2 },
|
||||
.supported_rotations = DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
|
||||
.hsu_filter_mode = VOP2_SCALE_UP_BIC,
|
||||
.hsd_filter_mode = VOP2_SCALE_DOWN_BIL,
|
||||
@@ -1020,8 +1016,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.formats = formats_win_full_10bit,
|
||||
.nformats = ARRAY_SIZE(formats_win_full_10bit),
|
||||
.format_modifiers = format_modifiers_afbc,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x1 },
|
||||
.layer_sel_id = 1,
|
||||
.supported_rotations = DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270 |
|
||||
DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
|
||||
@@ -1044,8 +1038,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.formats = formats_win_full_10bit,
|
||||
.nformats = ARRAY_SIZE(formats_win_full_10bit),
|
||||
.format_modifiers = format_modifiers_afbc,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x1 },
|
||||
.base = 0x80,
|
||||
.supported_rotations = DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
|
||||
.hsu_filter_mode = VOP2_SCALE_UP_BIC,
|
||||
@@ -1067,8 +1059,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.format_modifiers = format_modifiers,
|
||||
.base = 0x0,
|
||||
.layer_sel_id = 2,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x2 },
|
||||
.supported_rotations = DRM_MODE_REFLECT_Y,
|
||||
.hsu_filter_mode = VOP2_SCALE_UP_BIC,
|
||||
.hsd_filter_mode = VOP2_SCALE_DOWN_BIL,
|
||||
@@ -1091,8 +1081,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.nformats = ARRAY_SIZE(formats_win_lite),
|
||||
.format_modifiers = format_modifiers,
|
||||
.layer_sel_id = 3,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x2 },
|
||||
.supported_rotations = DRM_MODE_REFLECT_Y,
|
||||
.hsu_filter_mode = VOP2_SCALE_UP_BIC,
|
||||
.hsd_filter_mode = VOP2_SCALE_DOWN_BIL,
|
||||
@@ -1115,8 +1103,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.format_modifiers = format_modifiers,
|
||||
.base = 0x200,
|
||||
.layer_sel_id = 6,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x1 },
|
||||
.supported_rotations = DRM_MODE_REFLECT_Y,
|
||||
.hsu_filter_mode = VOP2_SCALE_UP_BIC,
|
||||
.hsd_filter_mode = VOP2_SCALE_DOWN_BIL,
|
||||
@@ -1139,8 +1125,6 @@ static const struct vop2_win_data rk3568_vop_win_data[] = {
|
||||
.format_modifiers = format_modifiers,
|
||||
.base = 0x600,
|
||||
.layer_sel_id = 7,
|
||||
/* RK3568, RK3566 */
|
||||
.possible_crtcs = { 0x7, 0x1 },
|
||||
.supported_rotations = DRM_MODE_REFLECT_Y,
|
||||
.hsu_filter_mode = VOP2_SCALE_UP_BIC,
|
||||
.hsd_filter_mode = VOP2_SCALE_DOWN_BIL,
|
||||
|
||||
Reference in New Issue
Block a user