History

Merge branch 'drm-fixes-4.3' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

Just two fixes for amdgpu: - fix pageflip interrupt issue - fix display clock handling on certain fiji boards * 'drm-fixes-4.3' of git://people.freedesktop.org/~agd5f/linux: drm/amdgpu: Keep the pflip interrupts always enabled v7 drm/amdgpu: adjust default dispclk (v2)

Dave Airlie committed 11 years ago

Commit 57606c72 parents b2293cb f6c7aba5 files · +90 −10Browse files

Unified · Split

5 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +6 −2
  2. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 −2
  3. drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +28 −2
  4. drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +28 −2
  5. drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +28 −2
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c+6−2
@@ -672,8 +672,12 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev) · 671 unmodified lines
672672 /* disp clock */
673673 adev->clock.default_dispclk =
674674 le32_to_cpu(firmware_info->info_21.ulDefaultDispEngineClkFreq);
675− if (adev->clock.default_dispclk == 0)
676− adev->clock.default_dispclk = 54000; /* 540 Mhz */
675+ /* set a reasonable default for DP */
676+ if (adev->clock.default_dispclk < 53900) {
677+ DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n",
678+ adev->clock.default_dispclk / 100);
679+ adev->clock.default_dispclk = 60000;
680+ }
677681 adev->clock.dp_extclk =
678682 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq);
679683 adev->clock.current_dispclk = adev->clock.default_dispclk;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+0−2
@@ -85,8 +85,6 @@ static void amdgpu_flip_work_func(struct work_struct *__work) · 84 unmodified lines
8585 /* We borrow the event spin lock for protecting flip_status */
8686 spin_lock_irqsave(&crtc->dev->event_lock, flags);
8787
88− /* set the proper interrupt */
89− amdgpu_irq_get(adev, &adev->pageflip_irq, work->crtc_id);
9088 /* do the flip (mmio) */
9189 adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);
9290 /* set the flip status */
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c+28−2
@@ -255,6 +255,24 @@ static u32 dce_v10_0_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 254 unmodified lines
255255 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]);
256256 }
257257
258+static void dce_v10_0_pageflip_interrupt_init(struct amdgpu_device *adev)
259+{
260+ unsigned i;
261+
262+ /* Enable pflip interrupts */
263+ for (i = 0; i < adev->mode_info.num_crtc; i++)
264+ amdgpu_irq_get(adev, &adev->pageflip_irq, i);
265+}
266+
267+static void dce_v10_0_pageflip_interrupt_fini(struct amdgpu_device *adev)
268+{
269+ unsigned i;
270+
271+ /* Disable pflip interrupts */
272+ for (i = 0; i < adev->mode_info.num_crtc; i++)
273+ amdgpu_irq_put(adev, &adev->pageflip_irq, i);
274+}
275+
258276 /**
259277 * dce_v10_0_page_flip - pageflip callback.
260278 *
@@ -2663,9 +2681,10 @@ static void dce_v10_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2402 unmodified lines
26632681 dce_v10_0_vga_enable(crtc, true);
26642682 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
26652683 dce_v10_0_vga_enable(crtc, false);
2666− /* Make sure VBLANK interrupt is still enabled */
2684+ /* Make sure VBLANK and PFLIP interrupts are still enabled */
26672685 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
26682686 amdgpu_irq_update(adev, &adev->crtc_irq, type);
2687+ amdgpu_irq_update(adev, &adev->pageflip_irq, type);
26692688 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
26702689 dce_v10_0_crtc_load_lut(crtc);
26712690 break;
@@ -3025,6 +3044,8 @@ static int dce_v10_0_hw_init(void *handle) · 353 unmodified lines
30253044 dce_v10_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30263045 }
30273046
3047+ dce_v10_0_pageflip_interrupt_init(adev);
3048+
30283049 return 0;
30293050 }
30303051
@@ -3039,6 +3060,8 @@ static int dce_v10_0_hw_fini(void *handle) · 8 unmodified lines
30393060 dce_v10_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30403061 }
30413062
3063+ dce_v10_0_pageflip_interrupt_fini(adev);
3064+
30423065 return 0;
30433066 }
30443067
@@ -3050,6 +3073,8 @@ static int dce_v10_0_suspend(void *handle) · 5 unmodified lines
30503073
30513074 dce_v10_0_hpd_fini(adev);
30523075
3076+ dce_v10_0_pageflip_interrupt_fini(adev);
3077+
30533078 return 0;
30543079 }
30553080
@@ -3075,6 +3100,8 @@ static int dce_v10_0_resume(void *handle) · 19 unmodified lines
30753100 /* initialize hpd */
30763101 dce_v10_0_hpd_init(adev);
30773102
3103+ dce_v10_0_pageflip_interrupt_init(adev);
3104+
30783105 return 0;
30793106 }
30803107
@@ -3369,7 +3396,6 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev, · 288 unmodified lines
33693396 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
33703397
33713398 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
3372− amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id);
33733399 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work);
33743400
33753401 return 0;
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c+28−2
@@ -233,6 +233,24 @@ static u32 dce_v11_0_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 232 unmodified lines
233233 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]);
234234 }
235235
236+static void dce_v11_0_pageflip_interrupt_init(struct amdgpu_device *adev)
237+{
238+ unsigned i;
239+
240+ /* Enable pflip interrupts */
241+ for (i = 0; i < adev->mode_info.num_crtc; i++)
242+ amdgpu_irq_get(adev, &adev->pageflip_irq, i);
243+}
244+
245+static void dce_v11_0_pageflip_interrupt_fini(struct amdgpu_device *adev)
246+{
247+ unsigned i;
248+
249+ /* Disable pflip interrupts */
250+ for (i = 0; i < adev->mode_info.num_crtc; i++)
251+ amdgpu_irq_put(adev, &adev->pageflip_irq, i);
252+}
253+
236254 /**
237255 * dce_v11_0_page_flip - pageflip callback.
238256 *
@@ -2640,9 +2658,10 @@ static void dce_v11_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2401 unmodified lines
26402658 dce_v11_0_vga_enable(crtc, true);
26412659 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
26422660 dce_v11_0_vga_enable(crtc, false);
2643− /* Make sure VBLANK interrupt is still enabled */
2661+ /* Make sure VBLANK and PFLIP interrupts are still enabled */
26442662 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
26452663 amdgpu_irq_update(adev, &adev->crtc_irq, type);
2664+ amdgpu_irq_update(adev, &adev->pageflip_irq, type);
26462665 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
26472666 dce_v11_0_crtc_load_lut(crtc);
26482667 break;
@@ -3000,6 +3019,8 @@ static int dce_v11_0_hw_init(void *handle) · 351 unmodified lines
30003019 dce_v11_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30013020 }
30023021
3022+ dce_v11_0_pageflip_interrupt_init(adev);
3023+
30033024 return 0;
30043025 }
30053026
@@ -3014,6 +3035,8 @@ static int dce_v11_0_hw_fini(void *handle) · 8 unmodified lines
30143035 dce_v11_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
30153036 }
30163037
3038+ dce_v11_0_pageflip_interrupt_fini(adev);
3039+
30173040 return 0;
30183041 }
30193042
@@ -3025,6 +3048,8 @@ static int dce_v11_0_suspend(void *handle) · 5 unmodified lines
30253048
30263049 dce_v11_0_hpd_fini(adev);
30273050
3051+ dce_v11_0_pageflip_interrupt_fini(adev);
3052+
30283053 return 0;
30293054 }
30303055
@@ -3051,6 +3076,8 @@ static int dce_v11_0_resume(void *handle) · 20 unmodified lines
30513076 /* initialize hpd */
30523077 dce_v11_0_hpd_init(adev);
30533078
3079+ dce_v11_0_pageflip_interrupt_init(adev);
3080+
30543081 return 0;
30553082 }
30563083
@@ -3345,7 +3372,6 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev, · 288 unmodified lines
33453372 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
33463373
33473374 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
3348− amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id);
33493375 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work);
33503376
33513377 return 0;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+28−2
@@ -204,6 +204,24 @@ static u32 dce_v8_0_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 203 unmodified lines
204204 return RREG32(mmCRTC_STATUS_FRAME_COUNT + crtc_offsets[crtc]);
205205 }
206206
207+static void dce_v8_0_pageflip_interrupt_init(struct amdgpu_device *adev)
208+{
209+ unsigned i;
210+
211+ /* Enable pflip interrupts */
212+ for (i = 0; i < adev->mode_info.num_crtc; i++)
213+ amdgpu_irq_get(adev, &adev->pageflip_irq, i);
214+}
215+
216+static void dce_v8_0_pageflip_interrupt_fini(struct amdgpu_device *adev)
217+{
218+ unsigned i;
219+
220+ /* Disable pflip interrupts */
221+ for (i = 0; i < adev->mode_info.num_crtc; i++)
222+ amdgpu_irq_put(adev, &adev->pageflip_irq, i);
223+}
224+
207225 /**
208226 * dce_v8_0_page_flip - pageflip callback.
209227 *
@@ -2575,9 +2593,10 @@ static void dce_v8_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2365 unmodified lines
25752593 dce_v8_0_vga_enable(crtc, true);
25762594 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
25772595 dce_v8_0_vga_enable(crtc, false);
2578− /* Make sure VBLANK interrupt is still enabled */
2596+ /* Make sure VBLANK and PFLIP interrupts are still enabled */
25792597 type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
25802598 amdgpu_irq_update(adev, &adev->crtc_irq, type);
2599+ amdgpu_irq_update(adev, &adev->pageflip_irq, type);
25812600 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
25822601 dce_v8_0_crtc_load_lut(crtc);
25832602 break;
@@ -2933,6 +2952,8 @@ static int dce_v8_0_hw_init(void *handle) · 349 unmodified lines
29332952 dce_v8_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
29342953 }
29352954
2955+ dce_v8_0_pageflip_interrupt_init(adev);
2956+
29362957 return 0;
29372958 }
29382959
@@ -2947,6 +2968,8 @@ static int dce_v8_0_hw_fini(void *handle) · 8 unmodified lines
29472968 dce_v8_0_audio_enable(adev, &adev->mode_info.audio.pin[i], false);
29482969 }
29492970
2971+ dce_v8_0_pageflip_interrupt_fini(adev);
2972+
29502973 return 0;
29512974 }
29522975
@@ -2958,6 +2981,8 @@ static int dce_v8_0_suspend(void *handle) · 5 unmodified lines
29582981
29592982 dce_v8_0_hpd_fini(adev);
29602983
2984+ dce_v8_0_pageflip_interrupt_fini(adev);
2985+
29612986 return 0;
29622987 }
29632988
@@ -2981,6 +3006,8 @@ static int dce_v8_0_resume(void *handle) · 17 unmodified lines
29813006 /* initialize hpd */
29823007 dce_v8_0_hpd_init(adev);
29833008
3009+ dce_v8_0_pageflip_interrupt_init(adev);
3010+
29843011 return 0;
29853012 }
29863013
@@ -3376,7 +3403,6 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev, · 389 unmodified lines
33763403 spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
33773404
33783405 drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
3379− amdgpu_irq_put(adev, &adev->pageflip_irq, crtc_id);
33803406 queue_work(amdgpu_crtc->pflip_queue, &works->unpin_work);
33813407
33823408 return 0;