Skip to content

Commit f82f204

Browse files
amazingfateigorpecovnik
authored andcommitted
drm changes from Mecotronic
1 parent bd032d5 commit f82f204

File tree

5 files changed

+82
-9
lines changed

5 files changed

+82
-9
lines changed

drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,9 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
27512751
if (edid_blob_ptr && edid_blob_ptr->length)
27522752
drm_edid = drm_edid_alloc(edid_blob_ptr->data, edid_blob_ptr->length);
27532753
else
2754-
drm_edid = drm_edid_read_ddc(connector, hdmi->ddc);
2754+
{
2755+
drm_edid = NULL;//@caco 20250623 drm_edid_read_ddc(connector, hdmi->ddc);
2756+
}
27552757

27562758
if (drm_edid)
27572759
edid = drm_edid_raw(drm_edid);
@@ -4712,8 +4714,8 @@ void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi)
47124714
disable_irq(hdmi->earc_irq);
47134715

47144716
pinctrl_pm_select_sleep_state(dev);
4715-
if (!hdmi->next_bridge)
4716-
drm_connector_update_edid_property(&hdmi->connector, NULL);
4717+
//if (!hdmi->next_bridge)
4718+
//drm_connector_update_edid_property(&hdmi->connector, NULL);
47174719
}
47184720
EXPORT_SYMBOL_GPL(dw_hdmi_qp_suspend);
47194721

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,12 @@ static int panel_simple_prepare(struct drm_panel *panel)
612612
if (p->desc->delay.prepare)
613613
panel_simple_msleep(p->desc->delay.prepare);
614614

615-
gpiod_direction_output(p->reset_gpio, 1);
615+
gpiod_direction_output(p->reset_gpio, 0);
616616

617617
if (p->desc->delay.reset)
618618
panel_simple_msleep(p->desc->delay.reset);
619619

620-
gpiod_direction_output(p->reset_gpio, 0);
620+
gpiod_direction_output(p->reset_gpio, 1);
621621

622622
if (p->desc->delay.init)
623623
panel_simple_msleep(p->desc->delay.init);

drivers/gpu/drm/rockchip/dw-dp.c

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,48 @@
270270

271271
#define DPTX_MAX_STREAMS 4
272272

273+
274+
//[email protected] set fixed resolution
275+
static const struct drm_display_mode dw_dp_default_modes[] = {
276+
/* 16 - 1920x1080@60Hz 16:9 */
277+
{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
278+
2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
279+
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
280+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
281+
/* 2 - 720x480@60Hz 4:3 */
282+
{ DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 27000, 720, 736,
283+
798, 858, 0, 480, 489, 495, 525, 0,
284+
DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
285+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
286+
/* 4 - 1280x720@60Hz 16:9 */
287+
{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
288+
1430, 1650, 0, 720, 725, 730, 750, 0,
289+
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
290+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
291+
/* 31 - 1920x1080@50Hz 16:9 */
292+
{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
293+
2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
294+
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
295+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
296+
/* 19 - 1280x720@50Hz 16:9 */
297+
{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
298+
1760, 1980, 0, 720, 725, 730, 750, 0,
299+
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
300+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
301+
/* 17 - 720x576@50Hz 4:3 */
302+
{ DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
303+
796, 864, 0, 576, 581, 586, 625, 0,
304+
DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
305+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
306+
/* 2 - 720x480@60Hz 4:3 */
307+
{ DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 27000, 720, 736,
308+
798, 858, 0, 480, 489, 495, 525, 0,
309+
DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
310+
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
311+
};
312+
313+
314+
273315
enum {
274316
RK3576_DP,
275317
RK3588_DP,
@@ -1441,7 +1483,9 @@ static int dw_dp_connector_get_modes(struct drm_connector *connector)
14411483
struct dw_dp *dp = connector_to_dp(connector);
14421484
struct drm_display_info *di = &connector->display_info;
14431485
struct edid *edid;
1486+
struct drm_display_mode *mode;
14441487
int num_modes = 0;
1488+
int i;
14451489

14461490
if (dp->right && dp->right->next_bridge) {
14471491
struct drm_bridge *bridge = dp->right->next_bridge;
@@ -1462,7 +1506,21 @@ static int dw_dp_connector_get_modes(struct drm_connector *connector)
14621506
edid = drm_bridge_get_edid(&dp->bridge, connector);
14631507
if (edid) {
14641508
drm_connector_update_edid_property(connector, edid);
1465-
num_modes = drm_add_edid_modes(connector, edid);
1509+
//[email protected] set fixed resolution
1510+
//num_modes = drm_add_edid_modes(connector, edid);
1511+
for (i = 0; i < ARRAY_SIZE(dw_dp_default_modes); i++) {
1512+
const struct drm_display_mode *ptr =
1513+
&dw_dp_default_modes[i];
1514+
1515+
mode = drm_mode_duplicate(connector->dev, ptr);
1516+
if (mode) {
1517+
if (!i)
1518+
mode->type = DRM_MODE_TYPE_PREFERRED;
1519+
drm_mode_probed_add(connector, mode);
1520+
num_modes++;
1521+
1522+
}
1523+
}
14661524
dw_dp_update_hdr_property(connector);
14671525
kfree(edid);
14681526
}

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,10 +2719,21 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder,
27192719

27202720
if (hdmi->plat_data->split_mode) {
27212721
s->output_flags |= ROCKCHIP_OUTPUT_DUAL_CHANNEL_LEFT_RIGHT_MODE;
2722-
if (hdmi->plat_data->right && hdmi->id)
2723-
s->output_flags |= ROCKCHIP_OUTPUT_DATA_SWAP;
2722+
//@caco 20250625
2723+
//if (hdmi->plat_data->right && hdmi->id)
2724+
// s->output_flags |= ROCKCHIP_OUTPUT_DATA_SWAP;
2725+
if (device_property_read_bool(hdmi->dev, "rockchip,split-right")) {
2726+
s->output_flags |= ROCKCHIP_OUTPUT_DATA_SWAP;
2727+
s->output_if_left_panel |= hdmi->id ? VOP_OUTPUT_IF_HDMI0 : VOP_OUTPUT_IF_HDMI1;
2728+
dev_info(hdmi->dev, "split Enabling data swap for right display (hdmi%d)\n", hdmi->id);
2729+
}
2730+
else {
2731+
s->output_flags |= ROCKCHIP_OUTPUT_DATA_SWAP;
2732+
s->output_if_left_panel |= hdmi->id ? VOP_OUTPUT_IF_HDMI1 : VOP_OUTPUT_IF_HDMI0;
2733+
dev_info(hdmi->dev, "split Enabling data swap for right display (hdmi%d)\n", hdmi->id);
2734+
}
27242735
s->output_if |= VOP_OUTPUT_IF_HDMI0 | VOP_OUTPUT_IF_HDMI1;
2725-
s->output_if_left_panel |= hdmi->id ? VOP_OUTPUT_IF_HDMI1 : VOP_OUTPUT_IF_HDMI0;
2736+
27262737
} else if (hdmi->plat_data->dual_connector_split) {
27272738
s->output_if |= hdmi->id ? VOP_OUTPUT_IF_HDMI1 : VOP_OUTPUT_IF_HDMI0;
27282739
s->output_flags |= ROCKCHIP_OUTPUT_DUAL_CONNECTOR_SPLIT_MODE;

drivers/gpu/drm/rockchip/rockchip_drm_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,8 @@ static struct drm_driver rockchip_drm_driver = {
22292229
.lastclose = rockchip_drm_lastclose,
22302230
.open = rockchip_drm_open,
22312231
.dumb_create = rockchip_gem_dumb_create,
2232+
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
2233+
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
22322234
.gem_prime_import = rockchip_drm_gem_prime_import,
22332235
.gem_prime_import_sg_table = rockchip_gem_prime_import_sg_table,
22342236
.gem_prime_mmap = drm_gem_prime_mmap,

0 commit comments

Comments
 (0)