mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
Merge tag 'drm-misc-fixes-2023-11-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Fixes for v6.7-rc3: - Panel fixes for innolux and auo,b101uan08.3 panel. - Fix ivpu MMIO reset. - AST fix on connetor disconnection. - nouveau gsp fix. - rockchip color fix. - Fix Himax83102-j02 timings. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/12322257-2e0c-43d3-8241-876aafc10e4a@linux.intel.com
This commit is contained in:
commit
8692160904
7 changed files with 113 additions and 46 deletions
|
@ -502,6 +502,16 @@ static int ivpu_boot_pwr_domain_enable(struct ivpu_device *vdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int ivpu_boot_pwr_domain_disable(struct ivpu_device *vdev)
|
||||
{
|
||||
ivpu_boot_dpu_active_drive(vdev, false);
|
||||
ivpu_boot_pwr_island_isolation_drive(vdev, true);
|
||||
ivpu_boot_pwr_island_trickle_drive(vdev, false);
|
||||
ivpu_boot_pwr_island_drive(vdev, false);
|
||||
|
||||
return ivpu_boot_wait_for_pwr_island_status(vdev, 0x0);
|
||||
}
|
||||
|
||||
static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)
|
||||
{
|
||||
u32 val = REGV_RD32(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES);
|
||||
|
@ -600,25 +610,17 @@ static int ivpu_hw_37xx_info_init(struct ivpu_device *vdev)
|
|||
|
||||
static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
|
||||
{
|
||||
int ret;
|
||||
u32 val;
|
||||
int ret = 0;
|
||||
|
||||
if (IVPU_WA(punit_disabled))
|
||||
return 0;
|
||||
|
||||
ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);
|
||||
if (ret) {
|
||||
ivpu_err(vdev, "Timed out waiting for TRIGGER bit\n");
|
||||
return ret;
|
||||
if (ivpu_boot_pwr_domain_disable(vdev)) {
|
||||
ivpu_err(vdev, "Failed to disable power domain\n");
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
val = REGB_RD32(VPU_37XX_BUTTRESS_VPU_IP_RESET);
|
||||
val = REG_SET_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, val);
|
||||
REGB_WR32(VPU_37XX_BUTTRESS_VPU_IP_RESET, val);
|
||||
|
||||
ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);
|
||||
if (ret)
|
||||
ivpu_err(vdev, "Timed out waiting for RESET completion\n");
|
||||
if (ivpu_pll_disable(vdev)) {
|
||||
ivpu_err(vdev, "Failed to disable PLL\n");
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -651,10 +653,6 @@ static int ivpu_hw_37xx_power_up(struct ivpu_device *vdev)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = ivpu_hw_37xx_reset(vdev);
|
||||
if (ret)
|
||||
ivpu_warn(vdev, "Failed to reset HW: %d\n", ret);
|
||||
|
||||
ret = ivpu_hw_37xx_d0i3_disable(vdev);
|
||||
if (ret)
|
||||
ivpu_warn(vdev, "Failed to disable D0I3: %d\n", ret);
|
||||
|
@ -722,11 +720,11 @@ static int ivpu_hw_37xx_power_down(struct ivpu_device *vdev)
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!ivpu_hw_37xx_is_idle(vdev) && ivpu_hw_37xx_reset(vdev))
|
||||
ivpu_err(vdev, "Failed to reset the VPU\n");
|
||||
if (!ivpu_hw_37xx_is_idle(vdev))
|
||||
ivpu_warn(vdev, "VPU not idle during power down\n");
|
||||
|
||||
if (ivpu_pll_disable(vdev)) {
|
||||
ivpu_err(vdev, "Failed to disable PLL\n");
|
||||
if (ivpu_hw_37xx_reset(vdev)) {
|
||||
ivpu_err(vdev, "Failed to reset VPU\n");
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
|
|
|
@ -174,6 +174,17 @@ to_ast_sil164_connector(struct drm_connector *connector)
|
|||
return container_of(connector, struct ast_sil164_connector, base);
|
||||
}
|
||||
|
||||
struct ast_bmc_connector {
|
||||
struct drm_connector base;
|
||||
struct drm_connector *physical_connector;
|
||||
};
|
||||
|
||||
static inline struct ast_bmc_connector *
|
||||
to_ast_bmc_connector(struct drm_connector *connector)
|
||||
{
|
||||
return container_of(connector, struct ast_bmc_connector, base);
|
||||
}
|
||||
|
||||
/*
|
||||
* Device
|
||||
*/
|
||||
|
@ -218,7 +229,7 @@ struct ast_device {
|
|||
} astdp;
|
||||
struct {
|
||||
struct drm_encoder encoder;
|
||||
struct drm_connector connector;
|
||||
struct ast_bmc_connector bmc_connector;
|
||||
} bmc;
|
||||
} output;
|
||||
|
||||
|
|
|
@ -1767,6 +1767,30 @@ static const struct drm_encoder_funcs ast_bmc_encoder_funcs = {
|
|||
.destroy = drm_encoder_cleanup,
|
||||
};
|
||||
|
||||
static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector,
|
||||
struct drm_modeset_acquire_ctx *ctx,
|
||||
bool force)
|
||||
{
|
||||
struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector);
|
||||
struct drm_connector *physical_connector = bmc_connector->physical_connector;
|
||||
|
||||
/*
|
||||
* Most user-space compositors cannot handle more than one connected
|
||||
* connector per CRTC. Hence, we only mark the BMC as connected if the
|
||||
* physical connector is disconnected. If the physical connector's status
|
||||
* is connected or unknown, the BMC remains disconnected. This has no
|
||||
* effect on the output of the BMC.
|
||||
*
|
||||
* FIXME: Remove this logic once user-space compositors can handle more
|
||||
* than one connector per CRTC. The BMC should always be connected.
|
||||
*/
|
||||
|
||||
if (physical_connector && physical_connector->status == connector_status_disconnected)
|
||||
return connector_status_connected;
|
||||
|
||||
return connector_status_disconnected;
|
||||
}
|
||||
|
||||
static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
return drm_add_modes_noedid(connector, 4096, 4096);
|
||||
|
@ -1774,6 +1798,7 @@ static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)
|
|||
|
||||
static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = {
|
||||
.get_modes = ast_bmc_connector_helper_get_modes,
|
||||
.detect_ctx = ast_bmc_connector_helper_detect_ctx,
|
||||
};
|
||||
|
||||
static const struct drm_connector_funcs ast_bmc_connector_funcs = {
|
||||
|
@ -1784,12 +1809,33 @@ static const struct drm_connector_funcs ast_bmc_connector_funcs = {
|
|||
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
|
||||
};
|
||||
|
||||
static int ast_bmc_output_init(struct ast_device *ast)
|
||||
static int ast_bmc_connector_init(struct drm_device *dev,
|
||||
struct ast_bmc_connector *bmc_connector,
|
||||
struct drm_connector *physical_connector)
|
||||
{
|
||||
struct drm_connector *connector = &bmc_connector->base;
|
||||
int ret;
|
||||
|
||||
ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);
|
||||
|
||||
bmc_connector->physical_connector = physical_connector;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ast_bmc_output_init(struct ast_device *ast,
|
||||
struct drm_connector *physical_connector)
|
||||
{
|
||||
struct drm_device *dev = &ast->base;
|
||||
struct drm_crtc *crtc = &ast->crtc;
|
||||
struct drm_encoder *encoder = &ast->output.bmc.encoder;
|
||||
struct drm_connector *connector = &ast->output.bmc.connector;
|
||||
struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector;
|
||||
struct drm_connector *connector = &bmc_connector->base;
|
||||
int ret;
|
||||
|
||||
ret = drm_encoder_init(dev, encoder,
|
||||
|
@ -1799,13 +1845,10 @@ static int ast_bmc_output_init(struct ast_device *ast)
|
|||
return ret;
|
||||
encoder->possible_crtcs = drm_crtc_mask(crtc);
|
||||
|
||||
ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_VIRTUAL);
|
||||
ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);
|
||||
|
||||
ret = drm_connector_attach_encoder(connector, encoder);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -1864,6 +1907,7 @@ static const struct drm_mode_config_funcs ast_mode_config_funcs = {
|
|||
int ast_mode_config_init(struct ast_device *ast)
|
||||
{
|
||||
struct drm_device *dev = &ast->base;
|
||||
struct drm_connector *physical_connector = NULL;
|
||||
int ret;
|
||||
|
||||
ret = drmm_mode_config_init(dev);
|
||||
|
@ -1904,23 +1948,27 @@ int ast_mode_config_init(struct ast_device *ast)
|
|||
ret = ast_vga_output_init(ast);
|
||||
if (ret)
|
||||
return ret;
|
||||
physical_connector = &ast->output.vga.vga_connector.base;
|
||||
}
|
||||
if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
|
||||
ret = ast_sil164_output_init(ast);
|
||||
if (ret)
|
||||
return ret;
|
||||
physical_connector = &ast->output.sil164.sil164_connector.base;
|
||||
}
|
||||
if (ast->tx_chip_types & AST_TX_DP501_BIT) {
|
||||
ret = ast_dp501_output_init(ast);
|
||||
if (ret)
|
||||
return ret;
|
||||
physical_connector = &ast->output.dp501.connector;
|
||||
}
|
||||
if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
|
||||
ret = ast_astdp_output_init(ast);
|
||||
if (ret)
|
||||
return ret;
|
||||
physical_connector = &ast->output.astdp.connector;
|
||||
}
|
||||
ret = ast_bmc_output_init(ast);
|
||||
ret = ast_bmc_output_init(ast, physical_connector);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -539,7 +539,7 @@ r535_fifo_runl_ctor(struct nvkm_fifo *fifo)
|
|||
struct nvkm_runl *runl;
|
||||
struct nvkm_engn *engn;
|
||||
u32 cgids = 2048;
|
||||
u32 chids = 2048 / CHID_PER_USERD;
|
||||
u32 chids = 2048;
|
||||
int ret;
|
||||
NV2080_CTRL_FIFO_GET_DEVICE_INFO_TABLE_PARAMS *ctrl;
|
||||
|
||||
|
|
|
@ -1709,6 +1709,7 @@ static const struct panel_desc auo_b101uan08_3_desc = {
|
|||
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
|
||||
MIPI_DSI_MODE_LPM,
|
||||
.init_cmds = auo_b101uan08_3_init_cmd,
|
||||
.lp11_before_reset = true,
|
||||
};
|
||||
|
||||
static const struct drm_display_mode boe_tv105wum_nw0_default_mode = {
|
||||
|
@ -1766,11 +1767,11 @@ static const struct panel_desc starry_qfh032011_53g_desc = {
|
|||
};
|
||||
|
||||
static const struct drm_display_mode starry_himax83102_j02_default_mode = {
|
||||
.clock = 161600,
|
||||
.clock = 162850,
|
||||
.hdisplay = 1200,
|
||||
.hsync_start = 1200 + 40,
|
||||
.hsync_end = 1200 + 40 + 20,
|
||||
.htotal = 1200 + 40 + 20 + 40,
|
||||
.hsync_start = 1200 + 50,
|
||||
.hsync_end = 1200 + 50 + 20,
|
||||
.htotal = 1200 + 50 + 20 + 50,
|
||||
.vdisplay = 1920,
|
||||
.vsync_start = 1920 + 116,
|
||||
.vsync_end = 1920 + 116 + 8,
|
||||
|
|
|
@ -2379,13 +2379,13 @@ static const struct panel_desc innolux_g070y2_t02 = {
|
|||
static const struct display_timing innolux_g101ice_l01_timing = {
|
||||
.pixelclock = { 60400000, 71100000, 74700000 },
|
||||
.hactive = { 1280, 1280, 1280 },
|
||||
.hfront_porch = { 41, 80, 100 },
|
||||
.hback_porch = { 40, 79, 99 },
|
||||
.hsync_len = { 1, 1, 1 },
|
||||
.hfront_porch = { 30, 60, 70 },
|
||||
.hback_porch = { 30, 60, 70 },
|
||||
.hsync_len = { 22, 40, 60 },
|
||||
.vactive = { 800, 800, 800 },
|
||||
.vfront_porch = { 5, 11, 14 },
|
||||
.vback_porch = { 4, 11, 14 },
|
||||
.vsync_len = { 1, 1, 1 },
|
||||
.vfront_porch = { 3, 8, 14 },
|
||||
.vback_porch = { 3, 8, 14 },
|
||||
.vsync_len = { 4, 7, 12 },
|
||||
.flags = DISPLAY_FLAGS_DE_HIGH,
|
||||
};
|
||||
|
||||
|
@ -2402,6 +2402,7 @@ static const struct panel_desc innolux_g101ice_l01 = {
|
|||
.disable = 200,
|
||||
},
|
||||
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
|
||||
.bus_flags = DRM_BUS_FLAG_DE_HIGH,
|
||||
.connector_type = DRM_MODE_CONNECTOR_LVDS,
|
||||
};
|
||||
|
||||
|
|
|
@ -247,14 +247,22 @@ static inline void vop_cfg_done(struct vop *vop)
|
|||
VOP_REG_SET(vop, common, cfg_done, 1);
|
||||
}
|
||||
|
||||
static bool has_rb_swapped(uint32_t format)
|
||||
static bool has_rb_swapped(uint32_t version, uint32_t format)
|
||||
{
|
||||
switch (format) {
|
||||
case DRM_FORMAT_XBGR8888:
|
||||
case DRM_FORMAT_ABGR8888:
|
||||
case DRM_FORMAT_BGR888:
|
||||
case DRM_FORMAT_BGR565:
|
||||
return true;
|
||||
/*
|
||||
* full framework (IP version 3.x) only need rb swapped for RGB888 and
|
||||
* little framework (IP version 2.x) only need rb swapped for BGR888,
|
||||
* check for 3.x to also only rb swap BGR888 for unknown vop version
|
||||
*/
|
||||
case DRM_FORMAT_RGB888:
|
||||
return VOP_MAJOR(version) == 3;
|
||||
case DRM_FORMAT_BGR888:
|
||||
return VOP_MAJOR(version) != 3;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -1030,7 +1038,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
|
|||
VOP_WIN_SET(vop, win, dsp_info, dsp_info);
|
||||
VOP_WIN_SET(vop, win, dsp_st, dsp_st);
|
||||
|
||||
rb_swap = has_rb_swapped(fb->format->format);
|
||||
rb_swap = has_rb_swapped(vop->data->version, fb->format->format);
|
||||
VOP_WIN_SET(vop, win, rb_swap, rb_swap);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue