Skip to content

Commit a6e434e

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "A few imx fixes I missed from a couple of weeks ago, they still aren't that big and fix some regression and a fail to boot problem. Other than that, a couple of regression fixes for radeon/amdgpu, one regression fix for vmwgfx and one regression fix for tda998x" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: Revert "drm/radeon/pm: adjust display configuration after powerstate" drm/amdgpu/dp: add back special handling for NUTMEG drm/radeon/dp: add back special handling for NUTMEG drm/i2c: tda998x: Choose between atomic or non atomic dpms helper drm/vmwgfx: Add back ->detect() and ->fill_modes() drm/radeon: Fix error handling in radeon_flip_work_func. drm/amdgpu: Fix error handling in amdgpu_flip_work_func. drm/imx: Add missing DRM_FORMAT_RGB565 to ipu_plane_formats drm/imx: notify DRM core about CRTC vblank state gpu: ipu-v3: Reset IPU before activating IRQ gpu: ipu-v3: Do not bail out on missing optional port nodes
2 parents 8205ff1 + 848819c commit a6e434e

File tree

10 files changed

+69
-30
lines changed

10 files changed

+69
-30
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
9696
* In practice this won't execute very often unless on very fast
9797
* machines because the time window for this to happen is very small.
9898
*/
99-
while (amdgpuCrtc->enabled && repcnt--) {
99+
while (amdgpuCrtc->enabled && --repcnt) {
100100
/* GET_DISTANCE_TO_VBLANKSTART returns distance to real vblank
101101
* start in hpos, and to the "fudged earlier" vblank start in
102102
* vpos.
@@ -112,13 +112,13 @@ static void amdgpu_flip_work_func(struct work_struct *__work)
112112
break;
113113

114114
/* Sleep at least until estimated real start of hw vblank */
115-
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
116115
min_udelay = (-hpos + 1) * max(vblank->linedur_ns / 1000, 5);
117116
if (min_udelay > vblank->framedur_ns / 2000) {
118117
/* Don't wait ridiculously long - something is wrong */
119118
repcnt = 0;
120119
break;
121120
}
121+
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
122122
usleep_range(min_udelay, 2 * min_udelay);
123123
spin_lock_irqsave(&crtc->dev->event_lock, flags);
124124
};

drivers/gpu/drm/amd/amdgpu/atombios_dp.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,27 @@ static int amdgpu_atombios_dp_get_dp_link_config(struct drm_connector *connector
265265
unsigned max_lane_num = drm_dp_max_lane_count(dpcd);
266266
unsigned lane_num, i, max_pix_clock;
267267

268-
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
269-
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
270-
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
268+
if (amdgpu_connector_encoder_get_dp_bridge_encoder_id(connector) ==
269+
ENCODER_OBJECT_ID_NUTMEG) {
270+
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
271+
max_pix_clock = (lane_num * 270000 * 8) / bpp;
271272
if (max_pix_clock >= pix_clock) {
272273
*dp_lanes = lane_num;
273-
*dp_rate = link_rates[i];
274+
*dp_rate = 270000;
274275
return 0;
275276
}
276277
}
278+
} else {
279+
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
280+
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
281+
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
282+
if (max_pix_clock >= pix_clock) {
283+
*dp_lanes = lane_num;
284+
*dp_rate = link_rates[i];
285+
return 0;
286+
}
287+
}
288+
}
277289
}
278290

279291
return -EINVAL;

drivers/gpu/drm/i2c/tda998x_drv.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,16 @@ static void tda998x_connector_destroy(struct drm_connector *connector)
13821382
drm_connector_cleanup(connector);
13831383
}
13841384

1385+
static int tda998x_connector_dpms(struct drm_connector *connector, int mode)
1386+
{
1387+
if (drm_core_check_feature(connector->dev, DRIVER_ATOMIC))
1388+
return drm_atomic_helper_connector_dpms(connector, mode);
1389+
else
1390+
return drm_helper_connector_dpms(connector, mode);
1391+
}
1392+
13851393
static const struct drm_connector_funcs tda998x_connector_funcs = {
1386-
.dpms = drm_atomic_helper_connector_dpms,
1394+
.dpms = tda998x_connector_dpms,
13871395
.reset = drm_atomic_helper_connector_reset,
13881396
.fill_modes = drm_helper_probe_single_connector_modes,
13891397
.detect = tda998x_connector_detect,

drivers/gpu/drm/imx/ipuv3-crtc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static void ipu_fb_enable(struct ipu_crtc *ipu_crtc)
6464
/* Start DC channel and DI after IDMAC */
6565
ipu_dc_enable_channel(ipu_crtc->dc);
6666
ipu_di_enable(ipu_crtc->di);
67+
drm_crtc_vblank_on(&ipu_crtc->base);
6768

6869
ipu_crtc->enabled = 1;
6970
}
@@ -80,6 +81,7 @@ static void ipu_fb_disable(struct ipu_crtc *ipu_crtc)
8081
ipu_di_disable(ipu_crtc->di);
8182
ipu_plane_disable(ipu_crtc->plane[0]);
8283
ipu_dc_disable(ipu);
84+
drm_crtc_vblank_off(&ipu_crtc->base);
8385

8486
ipu_crtc->enabled = 0;
8587
}

drivers/gpu/drm/imx/ipuv3-plane.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static const uint32_t ipu_plane_formats[] = {
4242
DRM_FORMAT_YVYU,
4343
DRM_FORMAT_YUV420,
4444
DRM_FORMAT_YVU420,
45+
DRM_FORMAT_RGB565,
4546
};
4647

4748
int ipu_plane_irq(struct ipu_plane *ipu_plane)

drivers/gpu/drm/radeon/atombios_dp.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,27 @@ int radeon_dp_get_dp_link_config(struct drm_connector *connector,
315315
unsigned max_lane_num = drm_dp_max_lane_count(dpcd);
316316
unsigned lane_num, i, max_pix_clock;
317317

318-
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
319-
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
320-
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
318+
if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) ==
319+
ENCODER_OBJECT_ID_NUTMEG) {
320+
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
321+
max_pix_clock = (lane_num * 270000 * 8) / bpp;
321322
if (max_pix_clock >= pix_clock) {
322323
*dp_lanes = lane_num;
323-
*dp_rate = link_rates[i];
324+
*dp_rate = 270000;
324325
return 0;
325326
}
326327
}
328+
} else {
329+
for (lane_num = 1; lane_num <= max_lane_num; lane_num <<= 1) {
330+
for (i = 0; i < ARRAY_SIZE(link_rates) && link_rates[i] <= max_link_rate; i++) {
331+
max_pix_clock = (lane_num * link_rates[i] * 8) / bpp;
332+
if (max_pix_clock >= pix_clock) {
333+
*dp_lanes = lane_num;
334+
*dp_rate = link_rates[i];
335+
return 0;
336+
}
337+
}
338+
}
327339
}
328340

329341
return -EINVAL;

drivers/gpu/drm/radeon/radeon_display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static void radeon_flip_work_func(struct work_struct *__work)
455455
* In practice this won't execute very often unless on very fast
456456
* machines because the time window for this to happen is very small.
457457
*/
458-
while (radeon_crtc->enabled && repcnt--) {
458+
while (radeon_crtc->enabled && --repcnt) {
459459
/* GET_DISTANCE_TO_VBLANKSTART returns distance to real vblank
460460
* start in hpos, and to the "fudged earlier" vblank start in
461461
* vpos.
@@ -471,13 +471,13 @@ static void radeon_flip_work_func(struct work_struct *__work)
471471
break;
472472

473473
/* Sleep at least until estimated real start of hw vblank */
474-
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
475474
min_udelay = (-hpos + 1) * max(vblank->linedur_ns / 1000, 5);
476475
if (min_udelay > vblank->framedur_ns / 2000) {
477476
/* Don't wait ridiculously long - something is wrong */
478477
repcnt = 0;
479478
break;
480479
}
480+
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
481481
usleep_range(min_udelay, 2 * min_udelay);
482482
spin_lock_irqsave(&crtc->dev->event_lock, flags);
483483
};

drivers/gpu/drm/radeon/radeon_pm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,8 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev)
10791079

10801080
/* update display watermarks based on new power state */
10811081
radeon_bandwidth_update(rdev);
1082+
/* update displays */
1083+
radeon_dpm_display_configuration_changed(rdev);
10821084

10831085
/* wait for the rings to drain */
10841086
for (i = 0; i < RADEON_NUM_RINGS; i++) {
@@ -1095,9 +1097,6 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev)
10951097

10961098
radeon_dpm_post_set_power_state(rdev);
10971099

1098-
/* update displays */
1099-
radeon_dpm_display_configuration_changed(rdev);
1100-
11011100
rdev->pm.dpm.current_active_crtcs = rdev->pm.dpm.new_active_crtcs;
11021101
rdev->pm.dpm.current_active_crtc_count = rdev->pm.dpm.new_active_crtc_count;
11031102
rdev->pm.dpm.single_display = single_display;

drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ static void vmw_sou_connector_destroy(struct drm_connector *connector)
563563

564564
static const struct drm_connector_funcs vmw_sou_connector_funcs = {
565565
.dpms = vmw_du_connector_dpms,
566+
.detect = vmw_du_connector_detect,
567+
.fill_modes = vmw_du_connector_fill_modes,
566568
.set_property = vmw_du_connector_set_property,
567569
.destroy = vmw_sou_connector_destroy,
568570
};

drivers/gpu/ipu-v3/ipu-common.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,24 +1050,27 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
10501050
for (i = 0; i < ARRAY_SIZE(client_reg); i++) {
10511051
const struct ipu_platform_reg *reg = &client_reg[i];
10521052
struct platform_device *pdev;
1053+
struct device_node *of_node;
1054+
1055+
/* Associate subdevice with the corresponding port node */
1056+
of_node = of_graph_get_port_by_id(dev->of_node, i);
1057+
if (!of_node) {
1058+
dev_info(dev,
1059+
"no port@%d node in %s, not using %s%d\n",
1060+
i, dev->of_node->full_name,
1061+
(i / 2) ? "DI" : "CSI", i % 2);
1062+
continue;
1063+
}
10531064

10541065
pdev = platform_device_alloc(reg->name, id++);
10551066
if (!pdev) {
10561067
ret = -ENOMEM;
10571068
goto err_register;
10581069
}
10591070

1071+
pdev->dev.of_node = of_node;
10601072
pdev->dev.parent = dev;
10611073

1062-
/* Associate subdevice with the corresponding port node */
1063-
pdev->dev.of_node = of_graph_get_port_by_id(dev->of_node, i);
1064-
if (!pdev->dev.of_node) {
1065-
dev_err(dev, "missing port@%d node in %s\n", i,
1066-
dev->of_node->full_name);
1067-
ret = -ENODEV;
1068-
goto err_register;
1069-
}
1070-
10711074
ret = platform_device_add_data(pdev, &reg->pdata,
10721075
sizeof(reg->pdata));
10731076
if (!ret)
@@ -1289,10 +1292,6 @@ static int ipu_probe(struct platform_device *pdev)
12891292
ipu->irq_sync = irq_sync;
12901293
ipu->irq_err = irq_err;
12911294

1292-
ret = ipu_irq_init(ipu);
1293-
if (ret)
1294-
goto out_failed_irq;
1295-
12961295
ret = device_reset(&pdev->dev);
12971296
if (ret) {
12981297
dev_err(&pdev->dev, "failed to reset: %d\n", ret);
@@ -1302,6 +1301,10 @@ static int ipu_probe(struct platform_device *pdev)
13021301
if (ret)
13031302
goto out_failed_reset;
13041303

1304+
ret = ipu_irq_init(ipu);
1305+
if (ret)
1306+
goto out_failed_irq;
1307+
13051308
/* Set MCU_T to divide MCU access window into 2 */
13061309
ipu_cm_write(ipu, 0x00400000L | (IPU_MCU_T_DEFAULT << 18),
13071310
IPU_DISP_GEN);
@@ -1324,9 +1327,9 @@ static int ipu_probe(struct platform_device *pdev)
13241327
failed_add_clients:
13251328
ipu_submodules_exit(ipu);
13261329
failed_submodules_init:
1327-
out_failed_reset:
13281330
ipu_irq_exit(ipu);
13291331
out_failed_irq:
1332+
out_failed_reset:
13301333
clk_disable_unprepare(ipu->clk);
13311334
return ret;
13321335
}

0 commit comments

Comments
 (0)