Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tidss: Add support for AM62A7 DSS

Add support for the DSS controller on TI's AM62A7 SoC in the tidss
driver.

This controller has 2 video pipelines that can render 2 video planes on
over a screen, using the overlay managers. The output of the DSS comes
from video port 2 (VP2) in the form of RGB88 DPI signals, while the VP1
is tied off inside the SoC.

Also add and use a new type of VP, DISPC_VP_TIED_OFF, for the tied-off
VP1 of AM62A DSS.

Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20231108171619.978438-3-a-bhatia1@ti.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

authored by

Aradhya Bhatia and committed by
Tomi Valkeinen
5cc5ea7b 7959ceb7

+63
+59
drivers/gpu/drm/tidss/tidss_dispc.c
··· 322 322 .vid_order = { 1, 0 }, 323 323 }; 324 324 325 + const struct dispc_features dispc_am62a7_feats = { 326 + /* 327 + * if the code reaches dispc_mode_valid with VP1, 328 + * it should return MODE_BAD. 329 + */ 330 + .max_pclk_khz = { 331 + [DISPC_VP_TIED_OFF] = 0, 332 + [DISPC_VP_DPI] = 165000, 333 + }, 334 + 335 + .scaling = { 336 + .in_width_max_5tap_rgb = 1280, 337 + .in_width_max_3tap_rgb = 2560, 338 + .in_width_max_5tap_yuv = 2560, 339 + .in_width_max_3tap_yuv = 4096, 340 + .upscale_limit = 16, 341 + .downscale_limit_5tap = 4, 342 + .downscale_limit_3tap = 2, 343 + /* 344 + * The max supported pixel inc value is 255. The value 345 + * of pixel inc is calculated like this: 1+(xinc-1)*bpp. 346 + * The maximum bpp of all formats supported by the HW 347 + * is 8. So the maximum supported xinc value is 32, 348 + * because 1+(32-1)*8 < 255 < 1+(33-1)*4. 349 + */ 350 + .xinc_max = 32, 351 + }, 352 + 353 + .subrev = DISPC_AM62A7, 354 + 355 + .common = "common", 356 + .common_regs = tidss_am65x_common_regs, 357 + 358 + .num_vps = 2, 359 + .vp_name = { "vp1", "vp2" }, 360 + .ovr_name = { "ovr1", "ovr2" }, 361 + .vpclk_name = { "vp1", "vp2" }, 362 + /* VP1 of the DSS in AM62A7 SoC is tied off internally */ 363 + .vp_bus_type = { DISPC_VP_TIED_OFF, DISPC_VP_DPI }, 364 + 365 + .vp_feat = { .color = { 366 + .has_ctm = true, 367 + .gamma_size = 256, 368 + .gamma_type = TIDSS_GAMMA_8BIT, 369 + }, 370 + }, 371 + 372 + .num_planes = 2, 373 + /* note: vid is plane_id 0 and vidl1 is plane_id 1 */ 374 + .vid_name = { "vid", "vidl1" }, 375 + .vid_lite = { false, true, }, 376 + .vid_order = { 1, 0 }, 377 + }; 378 + 325 379 static const u16 *dispc_common_regmap; 326 380 327 381 struct dss_vp_data { ··· 878 824 case DISPC_K2G: 879 825 return dispc_k2g_read_and_clear_irqstatus(dispc); 880 826 case DISPC_AM625: 827 + case DISPC_AM62A7: 881 828 case DISPC_AM65X: 882 829 case DISPC_J721E: 883 830 return dispc_k3_read_and_clear_irqstatus(dispc); ··· 895 840 dispc_k2g_set_irqenable(dispc, mask); 896 841 break; 897 842 case DISPC_AM625: 843 + case DISPC_AM62A7: 898 844 case DISPC_AM65X: 899 845 case DISPC_J721E: 900 846 dispc_k3_set_irqenable(dispc, mask); ··· 1387 1331 x, y, layer); 1388 1332 break; 1389 1333 case DISPC_AM625: 1334 + case DISPC_AM62A7: 1390 1335 case DISPC_AM65X: 1391 1336 dispc_am65x_ovr_set_plane(dispc, hw_plane, hw_videoport, 1392 1337 x, y, layer); ··· 2307 2250 dispc_k2g_plane_init(dispc); 2308 2251 break; 2309 2252 case DISPC_AM625: 2253 + case DISPC_AM62A7: 2310 2254 case DISPC_AM65X: 2311 2255 case DISPC_J721E: 2312 2256 dispc_k3_plane_init(dispc); ··· 2415 2357 dispc_k2g_vp_write_gamma_table(dispc, hw_videoport); 2416 2358 break; 2417 2359 case DISPC_AM625: 2360 + case DISPC_AM62A7: 2418 2361 case DISPC_AM65X: 2419 2362 dispc_am65x_vp_write_gamma_table(dispc, hw_videoport); 2420 2363 break;
+3
drivers/gpu/drm/tidss/tidss_dispc.h
··· 54 54 DISPC_VP_DPI, /* DPI output */ 55 55 DISPC_VP_OLDI, /* OLDI (LVDS) output */ 56 56 DISPC_VP_INTERNAL, /* SoC internal routing */ 57 + DISPC_VP_TIED_OFF, /* Tied off / Unavailable */ 57 58 DISPC_VP_MAX_BUS_TYPE, 58 59 }; 59 60 60 61 enum dispc_dss_subrevision { 61 62 DISPC_K2G, 62 63 DISPC_AM625, 64 + DISPC_AM62A7, 63 65 DISPC_AM65X, 64 66 DISPC_J721E, 65 67 }; ··· 90 88 91 89 extern const struct dispc_features dispc_k2g_feats; 92 90 extern const struct dispc_features dispc_am625_feats; 91 + extern const struct dispc_features dispc_am62a7_feats; 93 92 extern const struct dispc_features dispc_am65x_feats; 94 93 extern const struct dispc_features dispc_j721e_feats; 95 94
+1
drivers/gpu/drm/tidss/tidss_drv.c
··· 231 231 static const struct of_device_id tidss_of_table[] = { 232 232 { .compatible = "ti,k2g-dss", .data = &dispc_k2g_feats, }, 233 233 { .compatible = "ti,am625-dss", .data = &dispc_am625_feats, }, 234 + { .compatible = "ti,am62a7-dss", .data = &dispc_am62a7_feats, }, 234 235 { .compatible = "ti,am65x-dss", .data = &dispc_am65x_feats, }, 235 236 { .compatible = "ti,j721e-dss", .data = &dispc_j721e_feats, }, 236 237 { }