diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-03 21:15:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-03 21:15:48 -0400 |
commit | 101a6fd387801bbe164eafea3950b98f8e6440bb (patch) | |
tree | d147bb15ce5aa5b9afc03796ac10064d1c7fd8df | |
parent | 61f06db00e06b436dca4725c200c891ae8a4a92d (diff) | |
parent | 71aee81937963ccb07b3fa1b912e4cc6cd77dfa8 (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"One intel fix, one rockchip fix, and a bunch of radeon fixes for some
regressions from audio rework and vm stability"
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/i915/chv: Implement WaDisableShadowRegForCpd
drm/radeon: fix userptr return value checking (v2)
drm/radeon: check new address before removing old one
drm/radeon: reset BOs address after clearing it.
drm/radeon: fix lockup when BOs aren't part of the VM on release
drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5
drm/radeon: adjust pll when audio is not enabled
drm/radeon: only enable audio streams if the monitor supports it
drm/radeon: only mark audio as connected if the monitor supports it (v3)
drm/radeon/audio: don't enable packets until the end
drm/radeon: drop dce6_dp_enable
drm/radeon: fix ordering of AVI packet setup
drm/radeon: Use drm_calloc_ab for CS relocs
drm/rockchip: fix error check when getting irq
MAINTAINERS: add entry for Rockchip drm drivers
-rw-r--r-- | MAINTAINERS | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_uncore.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_encoders.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/dce6_afmt.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_hdmi.c | 53 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_hdmi.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_audio.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cs.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mn.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_vm.c | 36 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/si_dpm.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 |
15 files changed, 117 insertions, 94 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 16227759dfa8..781e099495d3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3413,6 +3413,13 @@ F: drivers/gpu/drm/rcar-du/ | |||
3413 | F: drivers/gpu/drm/shmobile/ | 3413 | F: drivers/gpu/drm/shmobile/ |
3414 | F: include/linux/platform_data/shmob_drm.h | 3414 | F: include/linux/platform_data/shmob_drm.h |
3415 | 3415 | ||
3416 | DRM DRIVERS FOR ROCKCHIP | ||
3417 | M: Mark Yao <mark.yao@rock-chips.com> | ||
3418 | L: dri-devel@lists.freedesktop.org | ||
3419 | S: Maintained | ||
3420 | F: drivers/gpu/drm/rockchip/ | ||
3421 | F: Documentation/devicetree/bindings/video/rockchip* | ||
3422 | |||
3416 | DSBR100 USB FM RADIO DRIVER | 3423 | DSBR100 USB FM RADIO DRIVER |
3417 | M: Alexey Klimov <klimov.linux@gmail.com> | 3424 | M: Alexey Klimov <klimov.linux@gmail.com> |
3418 | L: linux-media@vger.kernel.org | 3425 | L: linux-media@vger.kernel.org |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 3da1af46625c..773d1d24e604 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -6074,6 +6074,8 @@ enum skl_disp_power_wells { | |||
6074 | #define GTFIFOCTL 0x120008 | 6074 | #define GTFIFOCTL 0x120008 |
6075 | #define GT_FIFO_FREE_ENTRIES_MASK 0x7f | 6075 | #define GT_FIFO_FREE_ENTRIES_MASK 0x7f |
6076 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 | 6076 | #define GT_FIFO_NUM_RESERVED_ENTRIES 20 |
6077 | #define GT_FIFO_CTL_BLOCK_ALL_POLICY_STALL (1 << 12) | ||
6078 | #define GT_FIFO_CTL_RC6_POLICY_STALL (1 << 11) | ||
6077 | 6079 | ||
6078 | #define HSW_IDICR 0x9008 | 6080 | #define HSW_IDICR 0x9008 |
6079 | #define IDIHASHMSK(x) (((x) & 0x3f) << 16) | 6081 | #define IDIHASHMSK(x) (((x) & 0x3f) << 16) |
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index ab5cc94588e1..ff2a74651dd4 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c | |||
@@ -360,6 +360,14 @@ static void __intel_uncore_early_sanitize(struct drm_device *dev, | |||
360 | __raw_i915_write32(dev_priv, GTFIFODBG, | 360 | __raw_i915_write32(dev_priv, GTFIFODBG, |
361 | __raw_i915_read32(dev_priv, GTFIFODBG)); | 361 | __raw_i915_read32(dev_priv, GTFIFODBG)); |
362 | 362 | ||
363 | /* WaDisableShadowRegForCpd:chv */ | ||
364 | if (IS_CHERRYVIEW(dev)) { | ||
365 | __raw_i915_write32(dev_priv, GTFIFOCTL, | ||
366 | __raw_i915_read32(dev_priv, GTFIFOCTL) | | ||
367 | GT_FIFO_CTL_BLOCK_ALL_POLICY_STALL | | ||
368 | GT_FIFO_CTL_RC6_POLICY_STALL); | ||
369 | } | ||
370 | |||
363 | intel_uncore_forcewake_reset(dev, restore_forcewake); | 371 | intel_uncore_forcewake_reset(dev, restore_forcewake); |
364 | } | 372 | } |
365 | 373 | ||
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index dac78ad24b31..42b2ea3fdcf3 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -580,6 +580,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
580 | else | 580 | else |
581 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV; | 581 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV; |
582 | 582 | ||
583 | /* if there is no audio, set MINM_OVER_MAXP */ | ||
584 | if (!drm_detect_monitor_audio(radeon_connector_edid(connector))) | ||
585 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; | ||
583 | if (rdev->family < CHIP_RV770) | 586 | if (rdev->family < CHIP_RV770) |
584 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; | 587 | radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; |
585 | /* use frac fb div on APUs */ | 588 | /* use frac fb div on APUs */ |
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index f57c1ab617bc..dd39f434b4a7 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -1761,17 +1761,15 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
1761 | struct drm_device *dev = encoder->dev; | 1761 | struct drm_device *dev = encoder->dev; |
1762 | struct radeon_device *rdev = dev->dev_private; | 1762 | struct radeon_device *rdev = dev->dev_private; |
1763 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 1763 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
1764 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | ||
1765 | int encoder_mode = atombios_get_encoder_mode(encoder); | 1764 | int encoder_mode = atombios_get_encoder_mode(encoder); |
1766 | 1765 | ||
1767 | DRM_DEBUG_KMS("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n", | 1766 | DRM_DEBUG_KMS("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n", |
1768 | radeon_encoder->encoder_id, mode, radeon_encoder->devices, | 1767 | radeon_encoder->encoder_id, mode, radeon_encoder->devices, |
1769 | radeon_encoder->active_device); | 1768 | radeon_encoder->active_device); |
1770 | 1769 | ||
1771 | if (connector && (radeon_audio != 0) && | 1770 | if ((radeon_audio != 0) && |
1772 | ((encoder_mode == ATOM_ENCODER_MODE_HDMI) || | 1771 | ((encoder_mode == ATOM_ENCODER_MODE_HDMI) || |
1773 | (ENCODER_MODE_IS_DP(encoder_mode) && | 1772 | ENCODER_MODE_IS_DP(encoder_mode))) |
1774 | drm_detect_monitor_audio(radeon_connector_edid(connector))))) | ||
1775 | radeon_audio_dpms(encoder, mode); | 1773 | radeon_audio_dpms(encoder, mode); |
1776 | 1774 | ||
1777 | switch (radeon_encoder->encoder_id) { | 1775 | switch (radeon_encoder->encoder_id) { |
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c index 3adc2afe32aa..68fd9fc677e3 100644 --- a/drivers/gpu/drm/radeon/dce6_afmt.c +++ b/drivers/gpu/drm/radeon/dce6_afmt.c | |||
@@ -295,28 +295,3 @@ void dce6_dp_audio_set_dto(struct radeon_device *rdev, | |||
295 | WREG32(DCCG_AUDIO_DTO1_MODULE, clock); | 295 | WREG32(DCCG_AUDIO_DTO1_MODULE, clock); |
296 | } | 296 | } |
297 | } | 297 | } |
298 | |||
299 | void dce6_dp_enable(struct drm_encoder *encoder, bool enable) | ||
300 | { | ||
301 | struct drm_device *dev = encoder->dev; | ||
302 | struct radeon_device *rdev = dev->dev_private; | ||
303 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
304 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | ||
305 | |||
306 | if (!dig || !dig->afmt) | ||
307 | return; | ||
308 | |||
309 | if (enable) { | ||
310 | WREG32(EVERGREEN_DP_SEC_TIMESTAMP + dig->afmt->offset, | ||
311 | EVERGREEN_DP_SEC_TIMESTAMP_MODE(1)); | ||
312 | WREG32(EVERGREEN_DP_SEC_CNTL + dig->afmt->offset, | ||
313 | EVERGREEN_DP_SEC_ASP_ENABLE | /* Audio packet transmission */ | ||
314 | EVERGREEN_DP_SEC_ATP_ENABLE | /* Audio timestamp packet transmission */ | ||
315 | EVERGREEN_DP_SEC_AIP_ENABLE | /* Audio infoframe packet transmission */ | ||
316 | EVERGREEN_DP_SEC_STREAM_ENABLE); /* Master enable for secondary stream engine */ | ||
317 | } else { | ||
318 | WREG32(EVERGREEN_DP_SEC_CNTL + dig->afmt->offset, 0); | ||
319 | } | ||
320 | |||
321 | dig->afmt->enabled = enable; | ||
322 | } | ||
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index c18d4ecbd95d..0926739c9fa7 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
@@ -219,13 +219,9 @@ void evergreen_set_avi_packet(struct radeon_device *rdev, u32 offset, | |||
219 | WREG32(AFMT_AVI_INFO3 + offset, | 219 | WREG32(AFMT_AVI_INFO3 + offset, |
220 | frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24)); | 220 | frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24)); |
221 | 221 | ||
222 | WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset, | ||
223 | HDMI_AVI_INFO_SEND | /* enable AVI info frames */ | ||
224 | HDMI_AVI_INFO_CONT); /* required for audio info values to be updated */ | ||
225 | |||
226 | WREG32_P(HDMI_INFOFRAME_CONTROL1 + offset, | 222 | WREG32_P(HDMI_INFOFRAME_CONTROL1 + offset, |
227 | HDMI_AVI_INFO_LINE(2), /* anything other than 0 */ | 223 | HDMI_AVI_INFO_LINE(2), /* anything other than 0 */ |
228 | ~HDMI_AVI_INFO_LINE_MASK); | 224 | ~HDMI_AVI_INFO_LINE_MASK); |
229 | } | 225 | } |
230 | 226 | ||
231 | void dce4_hdmi_audio_set_dto(struct radeon_device *rdev, | 227 | void dce4_hdmi_audio_set_dto(struct radeon_device *rdev, |
@@ -370,9 +366,13 @@ void dce4_set_audio_packet(struct drm_encoder *encoder, u32 offset) | |||
370 | WREG32(AFMT_AUDIO_PACKET_CONTROL2 + offset, | 366 | WREG32(AFMT_AUDIO_PACKET_CONTROL2 + offset, |
371 | AFMT_AUDIO_CHANNEL_ENABLE(0xff)); | 367 | AFMT_AUDIO_CHANNEL_ENABLE(0xff)); |
372 | 368 | ||
369 | WREG32(HDMI_AUDIO_PACKET_CONTROL + offset, | ||
370 | HDMI_AUDIO_DELAY_EN(1) | /* set the default audio delay */ | ||
371 | HDMI_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient for all audio modes and small enough for all hblanks */ | ||
372 | |||
373 | /* allow 60958 channel status and send audio packets fields to be updated */ | 373 | /* allow 60958 channel status and send audio packets fields to be updated */ |
374 | WREG32(AFMT_AUDIO_PACKET_CONTROL + offset, | 374 | WREG32_OR(AFMT_AUDIO_PACKET_CONTROL + offset, |
375 | AFMT_AUDIO_SAMPLE_SEND | AFMT_RESET_FIFO_WHEN_AUDIO_DIS | AFMT_60958_CS_UPDATE); | 375 | AFMT_RESET_FIFO_WHEN_AUDIO_DIS | AFMT_60958_CS_UPDATE); |
376 | } | 376 | } |
377 | 377 | ||
378 | 378 | ||
@@ -398,17 +398,26 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) | |||
398 | return; | 398 | return; |
399 | 399 | ||
400 | if (enable) { | 400 | if (enable) { |
401 | WREG32(HDMI_INFOFRAME_CONTROL1 + dig->afmt->offset, | 401 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); |
402 | HDMI_AUDIO_INFO_LINE(2)); /* anything other than 0 */ | ||
403 | |||
404 | WREG32(HDMI_AUDIO_PACKET_CONTROL + dig->afmt->offset, | ||
405 | HDMI_AUDIO_DELAY_EN(1) | /* set the default audio delay */ | ||
406 | HDMI_AUDIO_PACKETS_PER_LINE(3)); /* should be suffient for all audio modes and small enough for all hblanks */ | ||
407 | 402 | ||
408 | WREG32(HDMI_INFOFRAME_CONTROL0 + dig->afmt->offset, | 403 | if (drm_detect_monitor_audio(radeon_connector_edid(connector))) { |
409 | HDMI_AUDIO_INFO_SEND | /* enable audio info frames (frames won't be set until audio is enabled) */ | 404 | WREG32(HDMI_INFOFRAME_CONTROL0 + dig->afmt->offset, |
410 | HDMI_AUDIO_INFO_CONT); /* required for audio info values to be updated */ | 405 | HDMI_AVI_INFO_SEND | /* enable AVI info frames */ |
406 | HDMI_AVI_INFO_CONT | /* required for audio info values to be updated */ | ||
407 | HDMI_AUDIO_INFO_SEND | /* enable audio info frames (frames won't be set until audio is enabled) */ | ||
408 | HDMI_AUDIO_INFO_CONT); /* required for audio info values to be updated */ | ||
409 | WREG32_OR(AFMT_AUDIO_PACKET_CONTROL + dig->afmt->offset, | ||
410 | AFMT_AUDIO_SAMPLE_SEND); | ||
411 | } else { | ||
412 | WREG32(HDMI_INFOFRAME_CONTROL0 + dig->afmt->offset, | ||
413 | HDMI_AVI_INFO_SEND | /* enable AVI info frames */ | ||
414 | HDMI_AVI_INFO_CONT); /* required for audio info values to be updated */ | ||
415 | WREG32_AND(AFMT_AUDIO_PACKET_CONTROL + dig->afmt->offset, | ||
416 | ~AFMT_AUDIO_SAMPLE_SEND); | ||
417 | } | ||
411 | } else { | 418 | } else { |
419 | WREG32_AND(AFMT_AUDIO_PACKET_CONTROL + dig->afmt->offset, | ||
420 | ~AFMT_AUDIO_SAMPLE_SEND); | ||
412 | WREG32(HDMI_INFOFRAME_CONTROL0 + dig->afmt->offset, 0); | 421 | WREG32(HDMI_INFOFRAME_CONTROL0 + dig->afmt->offset, 0); |
413 | } | 422 | } |
414 | 423 | ||
@@ -424,20 +433,24 @@ void evergreen_dp_enable(struct drm_encoder *encoder, bool enable) | |||
424 | struct radeon_device *rdev = dev->dev_private; | 433 | struct radeon_device *rdev = dev->dev_private; |
425 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 434 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
426 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 435 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
436 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | ||
427 | 437 | ||
428 | if (!dig || !dig->afmt) | 438 | if (!dig || !dig->afmt) |
429 | return; | 439 | return; |
430 | 440 | ||
431 | if (enable) { | 441 | if (enable && drm_detect_monitor_audio(radeon_connector_edid(connector))) { |
432 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | 442 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); |
433 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 443 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
434 | struct radeon_connector_atom_dig *dig_connector; | 444 | struct radeon_connector_atom_dig *dig_connector; |
435 | uint32_t val; | 445 | uint32_t val; |
436 | 446 | ||
447 | WREG32_OR(AFMT_AUDIO_PACKET_CONTROL + dig->afmt->offset, | ||
448 | AFMT_AUDIO_SAMPLE_SEND); | ||
449 | |||
437 | WREG32(EVERGREEN_DP_SEC_TIMESTAMP + dig->afmt->offset, | 450 | WREG32(EVERGREEN_DP_SEC_TIMESTAMP + dig->afmt->offset, |
438 | EVERGREEN_DP_SEC_TIMESTAMP_MODE(1)); | 451 | EVERGREEN_DP_SEC_TIMESTAMP_MODE(1)); |
439 | 452 | ||
440 | if (radeon_connector->con_priv) { | 453 | if (!ASIC_IS_DCE6(rdev) && radeon_connector->con_priv) { |
441 | dig_connector = radeon_connector->con_priv; | 454 | dig_connector = radeon_connector->con_priv; |
442 | val = RREG32(EVERGREEN_DP_SEC_AUD_N + dig->afmt->offset); | 455 | val = RREG32(EVERGREEN_DP_SEC_AUD_N + dig->afmt->offset); |
443 | val &= ~EVERGREEN_DP_SEC_N_BASE_MULTIPLE(0xf); | 456 | val &= ~EVERGREEN_DP_SEC_N_BASE_MULTIPLE(0xf); |
@@ -457,6 +470,8 @@ void evergreen_dp_enable(struct drm_encoder *encoder, bool enable) | |||
457 | EVERGREEN_DP_SEC_STREAM_ENABLE); /* Master enable for secondary stream engine */ | 470 | EVERGREEN_DP_SEC_STREAM_ENABLE); /* Master enable for secondary stream engine */ |
458 | } else { | 471 | } else { |
459 | WREG32(EVERGREEN_DP_SEC_CNTL + dig->afmt->offset, 0); | 472 | WREG32(EVERGREEN_DP_SEC_CNTL + dig->afmt->offset, 0); |
473 | WREG32_AND(AFMT_AUDIO_PACKET_CONTROL + dig->afmt->offset, | ||
474 | ~AFMT_AUDIO_SAMPLE_SEND); | ||
460 | } | 475 | } |
461 | 476 | ||
462 | dig->afmt->enabled = enable; | 477 | dig->afmt->enabled = enable; |
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index dd6606b8e23c..e85894ade95c 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -228,12 +228,13 @@ void r600_set_avi_packet(struct radeon_device *rdev, u32 offset, | |||
228 | WREG32(HDMI0_AVI_INFO3 + offset, | 228 | WREG32(HDMI0_AVI_INFO3 + offset, |
229 | frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24)); | 229 | frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24)); |
230 | 230 | ||
231 | WREG32_OR(HDMI0_INFOFRAME_CONTROL1 + offset, | ||
232 | HDMI0_AVI_INFO_LINE(2)); /* anything other than 0 */ | ||
233 | |||
231 | WREG32_OR(HDMI0_INFOFRAME_CONTROL0 + offset, | 234 | WREG32_OR(HDMI0_INFOFRAME_CONTROL0 + offset, |
232 | HDMI0_AVI_INFO_SEND | /* enable AVI info frames */ | 235 | HDMI0_AVI_INFO_SEND | /* enable AVI info frames */ |
233 | HDMI0_AVI_INFO_CONT); /* send AVI info frames every frame/field */ | 236 | HDMI0_AVI_INFO_CONT); /* send AVI info frames every frame/field */ |
234 | 237 | ||
235 | WREG32_OR(HDMI0_INFOFRAME_CONTROL1 + offset, | ||
236 | HDMI0_AVI_INFO_LINE(2)); /* anything other than 0 */ | ||
237 | } | 238 | } |
238 | 239 | ||
239 | /* | 240 | /* |
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index 48d49e651a30..8b82abb78df1 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c | |||
@@ -102,7 +102,6 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder, | |||
102 | void r600_hdmi_enable(struct drm_encoder *encoder, bool enable); | 102 | void r600_hdmi_enable(struct drm_encoder *encoder, bool enable); |
103 | void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable); | 103 | void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable); |
104 | void evergreen_dp_enable(struct drm_encoder *encoder, bool enable); | 104 | void evergreen_dp_enable(struct drm_encoder *encoder, bool enable); |
105 | void dce6_dp_enable(struct drm_encoder *encoder, bool enable); | ||
106 | 105 | ||
107 | static const u32 pin_offsets[7] = | 106 | static const u32 pin_offsets[7] = |
108 | { | 107 | { |
@@ -240,7 +239,7 @@ static struct radeon_audio_funcs dce6_dp_funcs = { | |||
240 | .set_avi_packet = evergreen_set_avi_packet, | 239 | .set_avi_packet = evergreen_set_avi_packet, |
241 | .set_audio_packet = dce4_set_audio_packet, | 240 | .set_audio_packet = dce4_set_audio_packet, |
242 | .mode_set = radeon_audio_dp_mode_set, | 241 | .mode_set = radeon_audio_dp_mode_set, |
243 | .dpms = dce6_dp_enable, | 242 | .dpms = evergreen_dp_enable, |
244 | }; | 243 | }; |
245 | 244 | ||
246 | static void radeon_audio_interface_init(struct radeon_device *rdev) | 245 | static void radeon_audio_interface_init(struct radeon_device *rdev) |
@@ -461,30 +460,33 @@ void radeon_audio_detect(struct drm_connector *connector, | |||
461 | if (!connector || !connector->encoder) | 460 | if (!connector || !connector->encoder) |
462 | return; | 461 | return; |
463 | 462 | ||
463 | if (!radeon_encoder_is_digital(connector->encoder)) | ||
464 | return; | ||
465 | |||
464 | rdev = connector->encoder->dev->dev_private; | 466 | rdev = connector->encoder->dev->dev_private; |
465 | radeon_encoder = to_radeon_encoder(connector->encoder); | 467 | radeon_encoder = to_radeon_encoder(connector->encoder); |
466 | dig = radeon_encoder->enc_priv; | 468 | dig = radeon_encoder->enc_priv; |
467 | 469 | ||
468 | if (status == connector_status_connected) { | 470 | if (!dig->afmt) |
469 | struct radeon_connector *radeon_connector; | 471 | return; |
470 | int sink_type; | ||
471 | |||
472 | if (!drm_detect_monitor_audio(radeon_connector_edid(connector))) { | ||
473 | radeon_encoder->audio = NULL; | ||
474 | return; | ||
475 | } | ||
476 | 472 | ||
477 | radeon_connector = to_radeon_connector(connector); | 473 | if (status == connector_status_connected) { |
478 | sink_type = radeon_dp_getsinktype(radeon_connector); | 474 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
479 | 475 | ||
480 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort && | 476 | if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort && |
481 | sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) | 477 | radeon_dp_getsinktype(radeon_connector) == |
478 | CONNECTOR_OBJECT_ID_DISPLAYPORT) | ||
482 | radeon_encoder->audio = rdev->audio.dp_funcs; | 479 | radeon_encoder->audio = rdev->audio.dp_funcs; |
483 | else | 480 | else |
484 | radeon_encoder->audio = rdev->audio.hdmi_funcs; | 481 | radeon_encoder->audio = rdev->audio.hdmi_funcs; |
485 | 482 | ||
486 | dig->afmt->pin = radeon_audio_get_pin(connector->encoder); | 483 | dig->afmt->pin = radeon_audio_get_pin(connector->encoder); |
487 | radeon_audio_enable(rdev, dig->afmt->pin, 0xf); | 484 | if (drm_detect_monitor_audio(radeon_connector_edid(connector))) { |
485 | radeon_audio_enable(rdev, dig->afmt->pin, 0xf); | ||
486 | } else { | ||
487 | radeon_audio_enable(rdev, dig->afmt->pin, 0); | ||
488 | dig->afmt->pin = NULL; | ||
489 | } | ||
488 | } else { | 490 | } else { |
489 | radeon_audio_enable(rdev, dig->afmt->pin, 0); | 491 | radeon_audio_enable(rdev, dig->afmt->pin, 0); |
490 | dig->afmt->pin = NULL; | 492 | dig->afmt->pin = NULL; |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index cebb65e07e1d..d17d251dbd4f 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -1379,8 +1379,10 @@ out: | |||
1379 | /* updated in get modes as well since we need to know if it's analog or digital */ | 1379 | /* updated in get modes as well since we need to know if it's analog or digital */ |
1380 | radeon_connector_update_scratch_regs(connector, ret); | 1380 | radeon_connector_update_scratch_regs(connector, ret); |
1381 | 1381 | ||
1382 | if (radeon_audio != 0) | 1382 | if (radeon_audio != 0) { |
1383 | radeon_connector_get_edid(connector); | ||
1383 | radeon_audio_detect(connector, ret); | 1384 | radeon_audio_detect(connector, ret); |
1385 | } | ||
1384 | 1386 | ||
1385 | exit: | 1387 | exit: |
1386 | pm_runtime_mark_last_busy(connector->dev->dev); | 1388 | pm_runtime_mark_last_busy(connector->dev->dev); |
@@ -1717,8 +1719,10 @@ radeon_dp_detect(struct drm_connector *connector, bool force) | |||
1717 | 1719 | ||
1718 | radeon_connector_update_scratch_regs(connector, ret); | 1720 | radeon_connector_update_scratch_regs(connector, ret); |
1719 | 1721 | ||
1720 | if (radeon_audio != 0) | 1722 | if (radeon_audio != 0) { |
1723 | radeon_connector_get_edid(connector); | ||
1721 | radeon_audio_detect(connector, ret); | 1724 | radeon_audio_detect(connector, ret); |
1725 | } | ||
1722 | 1726 | ||
1723 | out: | 1727 | out: |
1724 | pm_runtime_mark_last_busy(connector->dev->dev); | 1728 | pm_runtime_mark_last_busy(connector->dev->dev); |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 4d0f96cc3da4..ab39b85e0f76 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -88,7 +88,7 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) | |||
88 | p->dma_reloc_idx = 0; | 88 | p->dma_reloc_idx = 0; |
89 | /* FIXME: we assume that each relocs use 4 dwords */ | 89 | /* FIXME: we assume that each relocs use 4 dwords */ |
90 | p->nrelocs = chunk->length_dw / 4; | 90 | p->nrelocs = chunk->length_dw / 4; |
91 | p->relocs = kcalloc(p->nrelocs, sizeof(struct radeon_bo_list), GFP_KERNEL); | 91 | p->relocs = drm_calloc_large(p->nrelocs, sizeof(struct radeon_bo_list)); |
92 | if (p->relocs == NULL) { | 92 | if (p->relocs == NULL) { |
93 | return -ENOMEM; | 93 | return -ENOMEM; |
94 | } | 94 | } |
@@ -428,7 +428,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo | |||
428 | } | 428 | } |
429 | } | 429 | } |
430 | kfree(parser->track); | 430 | kfree(parser->track); |
431 | kfree(parser->relocs); | 431 | drm_free_large(parser->relocs); |
432 | drm_free_large(parser->vm_bos); | 432 | drm_free_large(parser->vm_bos); |
433 | for (i = 0; i < parser->nchunks; i++) | 433 | for (i = 0; i < parser->nchunks; i++) |
434 | drm_free_large(parser->chunks[i].kdata); | 434 | drm_free_large(parser->chunks[i].kdata); |
diff --git a/drivers/gpu/drm/radeon/radeon_mn.c b/drivers/gpu/drm/radeon/radeon_mn.c index 01701376b239..535bf404b725 100644 --- a/drivers/gpu/drm/radeon/radeon_mn.c +++ b/drivers/gpu/drm/radeon/radeon_mn.c | |||
@@ -135,7 +135,7 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn, | |||
135 | while (it) { | 135 | while (it) { |
136 | struct radeon_mn_node *node; | 136 | struct radeon_mn_node *node; |
137 | struct radeon_bo *bo; | 137 | struct radeon_bo *bo; |
138 | int r; | 138 | long r; |
139 | 139 | ||
140 | node = container_of(it, struct radeon_mn_node, it); | 140 | node = container_of(it, struct radeon_mn_node, it); |
141 | it = interval_tree_iter_next(it, start, end); | 141 | it = interval_tree_iter_next(it, start, end); |
@@ -144,19 +144,19 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn, | |||
144 | 144 | ||
145 | r = radeon_bo_reserve(bo, true); | 145 | r = radeon_bo_reserve(bo, true); |
146 | if (r) { | 146 | if (r) { |
147 | DRM_ERROR("(%d) failed to reserve user bo\n", r); | 147 | DRM_ERROR("(%ld) failed to reserve user bo\n", r); |
148 | continue; | 148 | continue; |
149 | } | 149 | } |
150 | 150 | ||
151 | r = reservation_object_wait_timeout_rcu(bo->tbo.resv, | 151 | r = reservation_object_wait_timeout_rcu(bo->tbo.resv, |
152 | true, false, MAX_SCHEDULE_TIMEOUT); | 152 | true, false, MAX_SCHEDULE_TIMEOUT); |
153 | if (r) | 153 | if (r <= 0) |
154 | DRM_ERROR("(%d) failed to wait for user bo\n", r); | 154 | DRM_ERROR("(%ld) failed to wait for user bo\n", r); |
155 | 155 | ||
156 | radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU); | 156 | radeon_ttm_placement_from_domain(bo, RADEON_GEM_DOMAIN_CPU); |
157 | r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); | 157 | r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); |
158 | if (r) | 158 | if (r) |
159 | DRM_ERROR("(%d) failed to validate user bo\n", r); | 159 | DRM_ERROR("(%ld) failed to validate user bo\n", r); |
160 | 160 | ||
161 | radeon_bo_unreserve(bo); | 161 | radeon_bo_unreserve(bo); |
162 | } | 162 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index 2a5a4a9e772d..de42fc4a22b8 100644 --- a/drivers/gpu/drm/radeon/radeon_vm.c +++ b/drivers/gpu/drm/radeon/radeon_vm.c | |||
@@ -473,6 +473,23 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, | |||
473 | } | 473 | } |
474 | 474 | ||
475 | mutex_lock(&vm->mutex); | 475 | mutex_lock(&vm->mutex); |
476 | soffset /= RADEON_GPU_PAGE_SIZE; | ||
477 | eoffset /= RADEON_GPU_PAGE_SIZE; | ||
478 | if (soffset || eoffset) { | ||
479 | struct interval_tree_node *it; | ||
480 | it = interval_tree_iter_first(&vm->va, soffset, eoffset - 1); | ||
481 | if (it && it != &bo_va->it) { | ||
482 | struct radeon_bo_va *tmp; | ||
483 | tmp = container_of(it, struct radeon_bo_va, it); | ||
484 | /* bo and tmp overlap, invalid offset */ | ||
485 | dev_err(rdev->dev, "bo %p va 0x%010Lx conflict with " | ||
486 | "(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo, | ||
487 | soffset, tmp->bo, tmp->it.start, tmp->it.last); | ||
488 | mutex_unlock(&vm->mutex); | ||
489 | return -EINVAL; | ||
490 | } | ||
491 | } | ||
492 | |||
476 | if (bo_va->it.start || bo_va->it.last) { | 493 | if (bo_va->it.start || bo_va->it.last) { |
477 | if (bo_va->addr) { | 494 | if (bo_va->addr) { |
478 | /* add a clone of the bo_va to clear the old address */ | 495 | /* add a clone of the bo_va to clear the old address */ |
@@ -490,6 +507,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, | |||
490 | spin_lock(&vm->status_lock); | 507 | spin_lock(&vm->status_lock); |
491 | list_add(&tmp->vm_status, &vm->freed); | 508 | list_add(&tmp->vm_status, &vm->freed); |
492 | spin_unlock(&vm->status_lock); | 509 | spin_unlock(&vm->status_lock); |
510 | |||
511 | bo_va->addr = 0; | ||
493 | } | 512 | } |
494 | 513 | ||
495 | interval_tree_remove(&bo_va->it, &vm->va); | 514 | interval_tree_remove(&bo_va->it, &vm->va); |
@@ -497,21 +516,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, | |||
497 | bo_va->it.last = 0; | 516 | bo_va->it.last = 0; |
498 | } | 517 | } |
499 | 518 | ||
500 | soffset /= RADEON_GPU_PAGE_SIZE; | ||
501 | eoffset /= RADEON_GPU_PAGE_SIZE; | ||
502 | if (soffset || eoffset) { | 519 | if (soffset || eoffset) { |
503 | struct interval_tree_node *it; | ||
504 | it = interval_tree_iter_first(&vm->va, soffset, eoffset - 1); | ||
505 | if (it) { | ||
506 | struct radeon_bo_va *tmp; | ||
507 | tmp = container_of(it, struct radeon_bo_va, it); | ||
508 | /* bo and tmp overlap, invalid offset */ | ||
509 | dev_err(rdev->dev, "bo %p va 0x%010Lx conflict with " | ||
510 | "(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo, | ||
511 | soffset, tmp->bo, tmp->it.start, tmp->it.last); | ||
512 | mutex_unlock(&vm->mutex); | ||
513 | return -EINVAL; | ||
514 | } | ||
515 | bo_va->it.start = soffset; | 520 | bo_va->it.start = soffset; |
516 | bo_va->it.last = eoffset - 1; | 521 | bo_va->it.last = eoffset - 1; |
517 | interval_tree_insert(&bo_va->it, &vm->va); | 522 | interval_tree_insert(&bo_va->it, &vm->va); |
@@ -1107,7 +1112,8 @@ void radeon_vm_bo_rmv(struct radeon_device *rdev, | |||
1107 | list_del(&bo_va->bo_list); | 1112 | list_del(&bo_va->bo_list); |
1108 | 1113 | ||
1109 | mutex_lock(&vm->mutex); | 1114 | mutex_lock(&vm->mutex); |
1110 | interval_tree_remove(&bo_va->it, &vm->va); | 1115 | if (bo_va->it.start || bo_va->it.last) |
1116 | interval_tree_remove(&bo_va->it, &vm->va); | ||
1111 | spin_lock(&vm->status_lock); | 1117 | spin_lock(&vm->status_lock); |
1112 | list_del(&bo_va->vm_status); | 1118 | list_del(&bo_va->vm_status); |
1113 | 1119 | ||
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index b35bccfeef79..ff8b83f5e929 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c | |||
@@ -2924,6 +2924,7 @@ struct si_dpm_quirk { | |||
2924 | static struct si_dpm_quirk si_dpm_quirk_list[] = { | 2924 | static struct si_dpm_quirk si_dpm_quirk_list[] = { |
2925 | /* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */ | 2925 | /* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */ |
2926 | { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 }, | 2926 | { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 }, |
2927 | { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 }, | ||
2927 | { 0, 0, 0, 0 }, | 2928 | { 0, 0, 0, 0 }, |
2928 | }; | 2929 | }; |
2929 | 2930 | ||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index ccb0ce073ef2..4557f335a8a5 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c | |||
@@ -1409,7 +1409,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data) | |||
1409 | struct vop *vop; | 1409 | struct vop *vop; |
1410 | struct resource *res; | 1410 | struct resource *res; |
1411 | size_t alloc_size; | 1411 | size_t alloc_size; |
1412 | int ret; | 1412 | int ret, irq; |
1413 | 1413 | ||
1414 | of_id = of_match_device(vop_driver_dt_match, dev); | 1414 | of_id = of_match_device(vop_driver_dt_match, dev); |
1415 | vop_data = of_id->data; | 1415 | vop_data = of_id->data; |
@@ -1445,11 +1445,12 @@ static int vop_bind(struct device *dev, struct device *master, void *data) | |||
1445 | return ret; | 1445 | return ret; |
1446 | } | 1446 | } |
1447 | 1447 | ||
1448 | vop->irq = platform_get_irq(pdev, 0); | 1448 | irq = platform_get_irq(pdev, 0); |
1449 | if (vop->irq < 0) { | 1449 | if (irq < 0) { |
1450 | dev_err(dev, "cannot find irq for vop\n"); | 1450 | dev_err(dev, "cannot find irq for vop\n"); |
1451 | return vop->irq; | 1451 | return irq; |
1452 | } | 1452 | } |
1453 | vop->irq = (unsigned int)irq; | ||
1453 | 1454 | ||
1454 | spin_lock_init(&vop->reg_lock); | 1455 | spin_lock_init(&vop->reg_lock); |
1455 | spin_lock_init(&vop->irq_lock); | 1456 | spin_lock_init(&vop->irq_lock); |