mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
drm/rockchip: use DRM_BUS_FLAG_PIXDATA_NEGEDGE to identify dclk polarity
Change-Id: Ie5c708d0d52e8909d5dc9257e0b6b76d3d960d82 Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
@@ -270,6 +270,7 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
|
|||||||
s->bus_format = di->bus_formats[0];
|
s->bus_format = di->bus_formats[0];
|
||||||
else
|
else
|
||||||
s->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
s->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
||||||
|
s->bus_flags = di->bus_flags;
|
||||||
s->tv_state = &conn_state->tv;
|
s->tv_state = &conn_state->tv;
|
||||||
s->eotf = TRADITIONAL_GAMMA_SDR;
|
s->eotf = TRADITIONAL_GAMMA_SDR;
|
||||||
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
||||||
|
|||||||
@@ -1352,6 +1352,7 @@ dw_mipi_dsi_encoder_atomic_check(struct drm_encoder *encoder,
|
|||||||
s->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
s->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
||||||
|
|
||||||
s->output_type = DRM_MODE_CONNECTOR_DSI;
|
s->output_type = DRM_MODE_CONNECTOR_DSI;
|
||||||
|
s->bus_flags = info->bus_flags;
|
||||||
s->tv_state = &conn_state->tv;
|
s->tv_state = &conn_state->tv;
|
||||||
s->eotf = TRADITIONAL_GAMMA_SDR;
|
s->eotf = TRADITIONAL_GAMMA_SDR;
|
||||||
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
||||||
|
|||||||
@@ -614,7 +614,10 @@ static int setup_initial_state(struct drm_device *drm_dev,
|
|||||||
mode->crtc_hsync_end == set->crtc_hsync_end &&
|
mode->crtc_hsync_end == set->crtc_hsync_end &&
|
||||||
mode->crtc_vsync_end == set->crtc_vsync_end &&
|
mode->crtc_vsync_end == set->crtc_vsync_end &&
|
||||||
drm_mode_vrefresh(mode) == set->vrefresh &&
|
drm_mode_vrefresh(mode) == set->vrefresh &&
|
||||||
mode->flags == set->flags &&
|
/* we just need to focus on DRM_MODE_FLAG_ALL flag, so here
|
||||||
|
* we compare mode->flags with set->flags & DRM_MODE_FLAG_ALL.
|
||||||
|
*/
|
||||||
|
mode->flags == (set->flags & DRM_MODE_FLAG_ALL) &&
|
||||||
mode->picture_aspect_ratio == set->picture_aspect_ratio) {
|
mode->picture_aspect_ratio == set->picture_aspect_ratio) {
|
||||||
found = 1;
|
found = 1;
|
||||||
match = 1;
|
match = 1;
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ struct rockchip_crtc_state {
|
|||||||
int output_mode;
|
int output_mode;
|
||||||
int output_bpc;
|
int output_bpc;
|
||||||
int output_flags;
|
int output_flags;
|
||||||
int bus_format;
|
u32 bus_format;
|
||||||
|
u32 bus_flags;
|
||||||
int yuv_overlay;
|
int yuv_overlay;
|
||||||
int post_r2y_en;
|
int post_r2y_en;
|
||||||
int post_y2r_en;
|
int post_y2r_en;
|
||||||
|
|||||||
@@ -2909,7 +2909,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
|
|||||||
if (vop->mcu_timing.mcu_pix_total)
|
if (vop->mcu_timing.mcu_pix_total)
|
||||||
vop_mcu_mode(crtc);
|
vop_mcu_mode(crtc);
|
||||||
|
|
||||||
dclk_inv = (adjusted_mode->flags & DRM_MODE_FLAG_PPIXDATA) ? 0 : 1;
|
dclk_inv = (s->bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE) ? 1 : 0;
|
||||||
|
|
||||||
VOP_CTRL_SET(vop, dclk_pol, dclk_inv);
|
VOP_CTRL_SET(vop, dclk_pol, dclk_inv);
|
||||||
val = (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ?
|
val = (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ?
|
||||||
@@ -4015,13 +4015,9 @@ static int vop_plane_init(struct vop *vop, struct vop_win *win,
|
|||||||
unsigned long possible_crtcs)
|
unsigned long possible_crtcs)
|
||||||
{
|
{
|
||||||
struct rockchip_drm_private *private = vop->drm_dev->dev_private;
|
struct rockchip_drm_private *private = vop->drm_dev->dev_private;
|
||||||
struct drm_plane *share = NULL;
|
|
||||||
uint64_t feature = 0;
|
uint64_t feature = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (win->parent)
|
|
||||||
share = &win->parent->base;
|
|
||||||
|
|
||||||
ret = drm_universal_plane_init(vop->drm_dev, &win->base, possible_crtcs, &vop_plane_funcs,
|
ret = drm_universal_plane_init(vop->drm_dev, &win->base, possible_crtcs, &vop_plane_funcs,
|
||||||
win->data_formats, win->nformats, NULL, win->type, NULL);
|
win->data_formats, win->nformats, NULL, win->type, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ rockchip_lvds_encoder_atomic_check(struct drm_encoder *encoder,
|
|||||||
s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
|
s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
|
||||||
|
|
||||||
s->output_type = DRM_MODE_CONNECTOR_LVDS;
|
s->output_type = DRM_MODE_CONNECTOR_LVDS;
|
||||||
|
s->bus_flags = info->bus_flags;
|
||||||
s->tv_state = &conn_state->tv;
|
s->tv_state = &conn_state->tv;
|
||||||
s->eotf = TRADITIONAL_GAMMA_SDR;
|
s->eotf = TRADITIONAL_GAMMA_SDR;
|
||||||
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ rockchip_rgb_encoder_atomic_check(struct drm_encoder *encoder,
|
|||||||
}
|
}
|
||||||
|
|
||||||
s->output_type = DRM_MODE_CONNECTOR_DPI;
|
s->output_type = DRM_MODE_CONNECTOR_DPI;
|
||||||
|
s->bus_flags = info->bus_flags;
|
||||||
s->tv_state = &conn_state->tv;
|
s->tv_state = &conn_state->tv;
|
||||||
s->eotf = TRADITIONAL_GAMMA_SDR;
|
s->eotf = TRADITIONAL_GAMMA_SDR;
|
||||||
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
s->color_space = V4L2_COLORSPACE_DEFAULT;
|
||||||
|
|||||||
Reference in New Issue
Block a user