mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
drm/rockchip: vop: add feature for alpha add scale
some version vop unsupport pixel alpha add scale, this case will lead to display error and post empty. Change-Id: I32820a14292b46ce61fd30bfccdaa5e4f635de49 Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
parent
285f058cfe
commit
9c0c016732
|
|
@ -1152,6 +1152,12 @@ static int rockchip_drm_create_properties(struct drm_device *dev)
|
|||
return -ENOMEM;
|
||||
private->blend_mode_prop = prop;
|
||||
|
||||
prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC,
|
||||
"ALPHA_SCALE", 0, 1);
|
||||
if (!prop)
|
||||
return -ENOMEM;
|
||||
private->alpha_scale_prop = prop;
|
||||
|
||||
return drm_mode_create_tv_properties(dev, 0, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ struct rockchip_drm_private {
|
|||
struct drm_property *color_space_prop;
|
||||
struct drm_property *global_alpha_prop;
|
||||
struct drm_property *blend_mode_prop;
|
||||
struct drm_property *alpha_scale_prop;
|
||||
void *backlight;
|
||||
struct drm_fb_helper *fbdev_helper;
|
||||
struct drm_gem_object *fbdev_bo;
|
||||
|
|
|
|||
|
|
@ -634,10 +634,16 @@ static void scl_vop_cal_scl_fac(struct vop *vop, struct vop_win *win,
|
|||
uint16_t lb_mode;
|
||||
uint32_t val;
|
||||
int vskiplines = 0;
|
||||
const struct vop_data *vop_data = vop->data;
|
||||
|
||||
if (!win->phy->scl)
|
||||
return;
|
||||
|
||||
if (!(vop_data->feature & VOP_FEATURE_ALPHA_SCALE)) {
|
||||
if (is_alpha_support(pixel_format) &&
|
||||
((src_w != dst_w) || (src_h != dst_h)))
|
||||
DRM_ERROR("ERROR : unsupport ppixel alpha add scale\n");
|
||||
}
|
||||
if (!win->phy->scl->ext) {
|
||||
VOP_SCL_SET(vop, win, scale_yrgb_x,
|
||||
scl_cal_scale2(src_w, dst_w));
|
||||
|
|
@ -3323,6 +3329,7 @@ static int vop_crtc_atomic_get_property(struct drm_crtc *crtc,
|
|||
struct rockchip_drm_private *private = drm_dev->dev_private;
|
||||
struct drm_mode_config *mode_config = &drm_dev->mode_config;
|
||||
struct rockchip_crtc_state *s = to_rockchip_crtc_state(state);
|
||||
struct vop *vop = to_vop(crtc);
|
||||
|
||||
if (property == mode_config->tv_left_margin_property) {
|
||||
*val = s->left_margin;
|
||||
|
|
@ -3374,6 +3381,11 @@ static int vop_crtc_atomic_get_property(struct drm_crtc *crtc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (property == private->alpha_scale_prop) {
|
||||
*val = (vop->data->feature & VOP_FEATURE_ALPHA_SCALE) ? 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DRM_ERROR("failed to get vop crtc property\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -3822,6 +3834,8 @@ static int vop_create_crtc(struct vop *vop)
|
|||
drm_object_attach_property(&crtc->base, private->cabc_stage_down_property, 0);
|
||||
drm_object_attach_property(&crtc->base, private->cabc_global_dn_property, 0);
|
||||
drm_object_attach_property(&crtc->base, private->cabc_calc_pixel_num_property, 0);
|
||||
drm_object_attach_property(&crtc->base, private->cabc_mode_property, 0);
|
||||
drm_object_attach_property(&crtc->base, private->alpha_scale_prop, 0);
|
||||
|
||||
if (vop_data->feature & VOP_FEATURE_AFBDC)
|
||||
feature |= BIT(ROCKCHIP_DRM_CRTC_FEATURE_AFBDC);
|
||||
|
|
|
|||
|
|
@ -398,6 +398,7 @@ struct vop_win_data {
|
|||
|
||||
#define VOP_FEATURE_OUTPUT_10BIT BIT(0)
|
||||
#define VOP_FEATURE_AFBDC BIT(1)
|
||||
#define VOP_FEATURE_ALPHA_SCALE BIT(2)
|
||||
|
||||
#define WIN_FEATURE_HDR2SDR BIT(0)
|
||||
#define WIN_FEATURE_SDR2HDR BIT(1)
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ static const struct vop_intr rk3288_vop_intr = {
|
|||
|
||||
static const struct vop_data rk3288_vop_big = {
|
||||
.version = VOP_VERSION(3, 0),
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT,
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT | VOP_FEATURE_ALPHA_SCALE,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {3840, 2160},
|
||||
.intr = &rk3288_vop_intr,
|
||||
|
|
@ -330,7 +330,7 @@ static const struct vop_data rk3288_vop_big = {
|
|||
|
||||
static const struct vop_data rk3288_vop_lit = {
|
||||
.version = VOP_VERSION(3, 0),
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT,
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT | VOP_FEATURE_ALPHA_SCALE,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {2560, 1600},
|
||||
.intr = &rk3288_vop_intr,
|
||||
|
|
@ -436,6 +436,7 @@ static const struct vop_win_data rk3368_vop_win_data[] = {
|
|||
|
||||
static const struct vop_data rk3368_vop = {
|
||||
.version = VOP_VERSION(3, 2),
|
||||
.feature = VOP_FEATURE_ALPHA_SCALE,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {4096, 2160},
|
||||
.intr = &rk3368_vop_intr,
|
||||
|
|
@ -456,6 +457,7 @@ static const struct vop_intr rk3366_vop_intr = {
|
|||
|
||||
static const struct vop_data rk3366_vop = {
|
||||
.version = VOP_VERSION(3, 4),
|
||||
.feature = VOP_FEATURE_ALPHA_SCALE,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {4096, 2160},
|
||||
.intr = &rk3366_vop_intr,
|
||||
|
|
@ -582,7 +584,8 @@ static const struct vop_win_data rk3399_vop_win_data[] = {
|
|||
static const struct vop_data rk3399_vop_big = {
|
||||
.version = VOP_VERSION(3, 5),
|
||||
.csc_table = &rk3399_csc_table,
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT | VOP_FEATURE_AFBDC,
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT | VOP_FEATURE_AFBDC |
|
||||
VOP_FEATURE_ALPHA_SCALE,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {4096, 2160},
|
||||
.intr = &rk3366_vop_intr,
|
||||
|
|
@ -607,6 +610,7 @@ static const struct vop_win_data rk3399_vop_lit_win_data[] = {
|
|||
|
||||
static const struct vop_data rk3399_vop_lit = {
|
||||
.version = VOP_VERSION(3, 6),
|
||||
.feature = VOP_FEATURE_ALPHA_SCALE,
|
||||
.csc_table = &rk3399_csc_table,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {2560, 1600},
|
||||
|
|
@ -625,7 +629,7 @@ static const struct vop_win_data rk322x_vop_win_data[] = {
|
|||
|
||||
static const struct vop_data rk322x_vop = {
|
||||
.version = VOP_VERSION(3, 7),
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT,
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT | VOP_FEATURE_ALPHA_SCALE,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {4096, 2160},
|
||||
.intr = &rk3366_vop_intr,
|
||||
|
|
@ -1012,7 +1016,7 @@ static const struct vop_win_data rk3328_vop_win_data[] = {
|
|||
|
||||
static const struct vop_data rk3328_vop = {
|
||||
.version = VOP_VERSION(3, 8),
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT,
|
||||
.feature = VOP_FEATURE_OUTPUT_10BIT | VOP_FEATURE_ALPHA_SCALE,
|
||||
.hdr_table = &rk3328_hdr_table,
|
||||
.max_input = {4096, 8192},
|
||||
.max_output = {4096, 2160},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user