Skip to content

Commit 8692160

Browse files
committed
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 <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents fca9a80 + ab93edb commit 8692160

File tree

7 files changed

+113
-46
lines changed

7 files changed

+113
-46
lines changed

drivers/accel/ivpu/ivpu_hw_37xx.c

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,16 @@ static int ivpu_boot_pwr_domain_enable(struct ivpu_device *vdev)
502502
return ret;
503503
}
504504

505+
static int ivpu_boot_pwr_domain_disable(struct ivpu_device *vdev)
506+
{
507+
ivpu_boot_dpu_active_drive(vdev, false);
508+
ivpu_boot_pwr_island_isolation_drive(vdev, true);
509+
ivpu_boot_pwr_island_trickle_drive(vdev, false);
510+
ivpu_boot_pwr_island_drive(vdev, false);
511+
512+
return ivpu_boot_wait_for_pwr_island_status(vdev, 0x0);
513+
}
514+
505515
static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)
506516
{
507517
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)
600610

601611
static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
602612
{
603-
int ret;
604-
u32 val;
605-
606-
if (IVPU_WA(punit_disabled))
607-
return 0;
613+
int ret = 0;
608614

609-
ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);
610-
if (ret) {
611-
ivpu_err(vdev, "Timed out waiting for TRIGGER bit\n");
612-
return ret;
615+
if (ivpu_boot_pwr_domain_disable(vdev)) {
616+
ivpu_err(vdev, "Failed to disable power domain\n");
617+
ret = -EIO;
613618
}
614619

615-
val = REGB_RD32(VPU_37XX_BUTTRESS_VPU_IP_RESET);
616-
val = REG_SET_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, val);
617-
REGB_WR32(VPU_37XX_BUTTRESS_VPU_IP_RESET, val);
618-
619-
ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);
620-
if (ret)
621-
ivpu_err(vdev, "Timed out waiting for RESET completion\n");
620+
if (ivpu_pll_disable(vdev)) {
621+
ivpu_err(vdev, "Failed to disable PLL\n");
622+
ret = -EIO;
623+
}
622624

623625
return ret;
624626
}
@@ -651,10 +653,6 @@ static int ivpu_hw_37xx_power_up(struct ivpu_device *vdev)
651653
{
652654
int ret;
653655

654-
ret = ivpu_hw_37xx_reset(vdev);
655-
if (ret)
656-
ivpu_warn(vdev, "Failed to reset HW: %d\n", ret);
657-
658656
ret = ivpu_hw_37xx_d0i3_disable(vdev);
659657
if (ret)
660658
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)
722720
{
723721
int ret = 0;
724722

725-
if (!ivpu_hw_37xx_is_idle(vdev) && ivpu_hw_37xx_reset(vdev))
726-
ivpu_err(vdev, "Failed to reset the VPU\n");
723+
if (!ivpu_hw_37xx_is_idle(vdev))
724+
ivpu_warn(vdev, "VPU not idle during power down\n");
727725

728-
if (ivpu_pll_disable(vdev)) {
729-
ivpu_err(vdev, "Failed to disable PLL\n");
726+
if (ivpu_hw_37xx_reset(vdev)) {
727+
ivpu_err(vdev, "Failed to reset VPU\n");
730728
ret = -EIO;
731729
}
732730

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ to_ast_sil164_connector(struct drm_connector *connector)
174174
return container_of(connector, struct ast_sil164_connector, base);
175175
}
176176

177+
struct ast_bmc_connector {
178+
struct drm_connector base;
179+
struct drm_connector *physical_connector;
180+
};
181+
182+
static inline struct ast_bmc_connector *
183+
to_ast_bmc_connector(struct drm_connector *connector)
184+
{
185+
return container_of(connector, struct ast_bmc_connector, base);
186+
}
187+
177188
/*
178189
* Device
179190
*/
@@ -218,7 +229,7 @@ struct ast_device {
218229
} astdp;
219230
struct {
220231
struct drm_encoder encoder;
221-
struct drm_connector connector;
232+
struct ast_bmc_connector bmc_connector;
222233
} bmc;
223234
} output;
224235

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,13 +1767,38 @@ static const struct drm_encoder_funcs ast_bmc_encoder_funcs = {
17671767
.destroy = drm_encoder_cleanup,
17681768
};
17691769

1770+
static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector,
1771+
struct drm_modeset_acquire_ctx *ctx,
1772+
bool force)
1773+
{
1774+
struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector);
1775+
struct drm_connector *physical_connector = bmc_connector->physical_connector;
1776+
1777+
/*
1778+
* Most user-space compositors cannot handle more than one connected
1779+
* connector per CRTC. Hence, we only mark the BMC as connected if the
1780+
* physical connector is disconnected. If the physical connector's status
1781+
* is connected or unknown, the BMC remains disconnected. This has no
1782+
* effect on the output of the BMC.
1783+
*
1784+
* FIXME: Remove this logic once user-space compositors can handle more
1785+
* than one connector per CRTC. The BMC should always be connected.
1786+
*/
1787+
1788+
if (physical_connector && physical_connector->status == connector_status_disconnected)
1789+
return connector_status_connected;
1790+
1791+
return connector_status_disconnected;
1792+
}
1793+
17701794
static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)
17711795
{
17721796
return drm_add_modes_noedid(connector, 4096, 4096);
17731797
}
17741798

17751799
static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = {
17761800
.get_modes = ast_bmc_connector_helper_get_modes,
1801+
.detect_ctx = ast_bmc_connector_helper_detect_ctx,
17771802
};
17781803

17791804
static const struct drm_connector_funcs ast_bmc_connector_funcs = {
@@ -1784,12 +1809,33 @@ static const struct drm_connector_funcs ast_bmc_connector_funcs = {
17841809
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
17851810
};
17861811

1787-
static int ast_bmc_output_init(struct ast_device *ast)
1812+
static int ast_bmc_connector_init(struct drm_device *dev,
1813+
struct ast_bmc_connector *bmc_connector,
1814+
struct drm_connector *physical_connector)
1815+
{
1816+
struct drm_connector *connector = &bmc_connector->base;
1817+
int ret;
1818+
1819+
ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
1820+
DRM_MODE_CONNECTOR_VIRTUAL);
1821+
if (ret)
1822+
return ret;
1823+
1824+
drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);
1825+
1826+
bmc_connector->physical_connector = physical_connector;
1827+
1828+
return 0;
1829+
}
1830+
1831+
static int ast_bmc_output_init(struct ast_device *ast,
1832+
struct drm_connector *physical_connector)
17881833
{
17891834
struct drm_device *dev = &ast->base;
17901835
struct drm_crtc *crtc = &ast->crtc;
17911836
struct drm_encoder *encoder = &ast->output.bmc.encoder;
1792-
struct drm_connector *connector = &ast->output.bmc.connector;
1837+
struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector;
1838+
struct drm_connector *connector = &bmc_connector->base;
17931839
int ret;
17941840

17951841
ret = drm_encoder_init(dev, encoder,
@@ -1799,13 +1845,10 @@ static int ast_bmc_output_init(struct ast_device *ast)
17991845
return ret;
18001846
encoder->possible_crtcs = drm_crtc_mask(crtc);
18011847

1802-
ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
1803-
DRM_MODE_CONNECTOR_VIRTUAL);
1848+
ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector);
18041849
if (ret)
18051850
return ret;
18061851

1807-
drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);
1808-
18091852
ret = drm_connector_attach_encoder(connector, encoder);
18101853
if (ret)
18111854
return ret;
@@ -1864,6 +1907,7 @@ static const struct drm_mode_config_funcs ast_mode_config_funcs = {
18641907
int ast_mode_config_init(struct ast_device *ast)
18651908
{
18661909
struct drm_device *dev = &ast->base;
1910+
struct drm_connector *physical_connector = NULL;
18671911
int ret;
18681912

18691913
ret = drmm_mode_config_init(dev);
@@ -1904,23 +1948,27 @@ int ast_mode_config_init(struct ast_device *ast)
19041948
ret = ast_vga_output_init(ast);
19051949
if (ret)
19061950
return ret;
1951+
physical_connector = &ast->output.vga.vga_connector.base;
19071952
}
19081953
if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
19091954
ret = ast_sil164_output_init(ast);
19101955
if (ret)
19111956
return ret;
1957+
physical_connector = &ast->output.sil164.sil164_connector.base;
19121958
}
19131959
if (ast->tx_chip_types & AST_TX_DP501_BIT) {
19141960
ret = ast_dp501_output_init(ast);
19151961
if (ret)
19161962
return ret;
1963+
physical_connector = &ast->output.dp501.connector;
19171964
}
19181965
if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
19191966
ret = ast_astdp_output_init(ast);
19201967
if (ret)
19211968
return ret;
1969+
physical_connector = &ast->output.astdp.connector;
19221970
}
1923-
ret = ast_bmc_output_init(ast);
1971+
ret = ast_bmc_output_init(ast, physical_connector);
19241972
if (ret)
19251973
return ret;
19261974

drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ r535_fifo_runl_ctor(struct nvkm_fifo *fifo)
539539
struct nvkm_runl *runl;
540540
struct nvkm_engn *engn;
541541
u32 cgids = 2048;
542-
u32 chids = 2048 / CHID_PER_USERD;
542+
u32 chids = 2048;
543543
int ret;
544544
NV2080_CTRL_FIFO_GET_DEVICE_INFO_TABLE_PARAMS *ctrl;
545545

drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,7 @@ static const struct panel_desc auo_b101uan08_3_desc = {
17091709
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
17101710
MIPI_DSI_MODE_LPM,
17111711
.init_cmds = auo_b101uan08_3_init_cmd,
1712+
.lp11_before_reset = true,
17121713
};
17131714

17141715
static const struct drm_display_mode boe_tv105wum_nw0_default_mode = {
@@ -1766,11 +1767,11 @@ static const struct panel_desc starry_qfh032011_53g_desc = {
17661767
};
17671768

17681769
static const struct drm_display_mode starry_himax83102_j02_default_mode = {
1769-
.clock = 161600,
1770+
.clock = 162850,
17701771
.hdisplay = 1200,
1771-
.hsync_start = 1200 + 40,
1772-
.hsync_end = 1200 + 40 + 20,
1773-
.htotal = 1200 + 40 + 20 + 40,
1772+
.hsync_start = 1200 + 50,
1773+
.hsync_end = 1200 + 50 + 20,
1774+
.htotal = 1200 + 50 + 20 + 50,
17741775
.vdisplay = 1920,
17751776
.vsync_start = 1920 + 116,
17761777
.vsync_end = 1920 + 116 + 8,

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,13 +2379,13 @@ static const struct panel_desc innolux_g070y2_t02 = {
23792379
static const struct display_timing innolux_g101ice_l01_timing = {
23802380
.pixelclock = { 60400000, 71100000, 74700000 },
23812381
.hactive = { 1280, 1280, 1280 },
2382-
.hfront_porch = { 41, 80, 100 },
2383-
.hback_porch = { 40, 79, 99 },
2384-
.hsync_len = { 1, 1, 1 },
2382+
.hfront_porch = { 30, 60, 70 },
2383+
.hback_porch = { 30, 60, 70 },
2384+
.hsync_len = { 22, 40, 60 },
23852385
.vactive = { 800, 800, 800 },
2386-
.vfront_porch = { 5, 11, 14 },
2387-
.vback_porch = { 4, 11, 14 },
2388-
.vsync_len = { 1, 1, 1 },
2386+
.vfront_porch = { 3, 8, 14 },
2387+
.vback_porch = { 3, 8, 14 },
2388+
.vsync_len = { 4, 7, 12 },
23892389
.flags = DISPLAY_FLAGS_DE_HIGH,
23902390
};
23912391

@@ -2402,6 +2402,7 @@ static const struct panel_desc innolux_g101ice_l01 = {
24022402
.disable = 200,
24032403
},
24042404
.bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2405+
.bus_flags = DRM_BUS_FLAG_DE_HIGH,
24052406
.connector_type = DRM_MODE_CONNECTOR_LVDS,
24062407
};
24072408

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,22 @@ static inline void vop_cfg_done(struct vop *vop)
247247
VOP_REG_SET(vop, common, cfg_done, 1);
248248
}
249249

250-
static bool has_rb_swapped(uint32_t format)
250+
static bool has_rb_swapped(uint32_t version, uint32_t format)
251251
{
252252
switch (format) {
253253
case DRM_FORMAT_XBGR8888:
254254
case DRM_FORMAT_ABGR8888:
255-
case DRM_FORMAT_BGR888:
256255
case DRM_FORMAT_BGR565:
257256
return true;
257+
/*
258+
* full framework (IP version 3.x) only need rb swapped for RGB888 and
259+
* little framework (IP version 2.x) only need rb swapped for BGR888,
260+
* check for 3.x to also only rb swap BGR888 for unknown vop version
261+
*/
262+
case DRM_FORMAT_RGB888:
263+
return VOP_MAJOR(version) == 3;
264+
case DRM_FORMAT_BGR888:
265+
return VOP_MAJOR(version) != 3;
258266
default:
259267
return false;
260268
}
@@ -1030,7 +1038,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
10301038
VOP_WIN_SET(vop, win, dsp_info, dsp_info);
10311039
VOP_WIN_SET(vop, win, dsp_st, dsp_st);
10321040

1033-
rb_swap = has_rb_swapped(fb->format->format);
1041+
rb_swap = has_rb_swapped(vop->data->version, fb->format->format);
10341042
VOP_WIN_SET(vop, win, rb_swap, rb_swap);
10351043

10361044
/*

0 commit comments

Comments
 (0)