diff options
author | Emily Deng <Emily.Deng@amd.com> | 2016-08-17 02:59:20 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-08-17 15:42:50 -0400 |
commit | 041aa65805de1a8af87dab2a26e52ebfe01f1963 (patch) | |
tree | 3829e66af410bf258c2b2c8a227d1d8438f77af0 /drivers/gpu/drm/amd/amdgpu/dce_virtual.c | |
parent | 89a8f30900754eb27f8f534f35be49b8202c76cd (diff) |
drm/amdgpu: Hardcode virtual DCE vblank / scanout position return values
For virtual display feature, by hardcoding 0 for the vblank counter and
-EINVAL for the scanout position return value, we signal to the core DRM code that there are
no hardware counters we can use for these.
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/dce_virtual.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c index 6f533a0dbdb4..00663a7b4053 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c | |||
@@ -55,10 +55,7 @@ static void dce_virtual_vblank_wait(struct amdgpu_device *adev, int crtc) | |||
55 | 55 | ||
56 | static u32 dce_virtual_vblank_get_counter(struct amdgpu_device *adev, int crtc) | 56 | static u32 dce_virtual_vblank_get_counter(struct amdgpu_device *adev, int crtc) |
57 | { | 57 | { |
58 | if (crtc >= adev->mode_info.num_crtc) | 58 | return 0; |
59 | return 0; | ||
60 | else | ||
61 | return adev->ddev->vblank[crtc].count; | ||
62 | } | 59 | } |
63 | 60 | ||
64 | static void dce_virtual_page_flip(struct amdgpu_device *adev, | 61 | static void dce_virtual_page_flip(struct amdgpu_device *adev, |
@@ -70,13 +67,10 @@ static void dce_virtual_page_flip(struct amdgpu_device *adev, | |||
70 | static int dce_virtual_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc, | 67 | static int dce_virtual_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc, |
71 | u32 *vbl, u32 *position) | 68 | u32 *vbl, u32 *position) |
72 | { | 69 | { |
73 | if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc)) | ||
74 | return -EINVAL; | ||
75 | |||
76 | *vbl = 0; | 70 | *vbl = 0; |
77 | *position = 0; | 71 | *position = 0; |
78 | 72 | ||
79 | return 0; | 73 | return -EINVAL; |
80 | } | 74 | } |
81 | 75 | ||
82 | static bool dce_virtual_hpd_sense(struct amdgpu_device *adev, | 76 | static bool dce_virtual_hpd_sense(struct amdgpu_device *adev, |
@@ -407,6 +401,8 @@ static int dce_virtual_sw_init(void *handle) | |||
407 | if (r) | 401 | if (r) |
408 | return r; | 402 | return r; |
409 | 403 | ||
404 | adev->ddev->max_vblank_count = 0; | ||
405 | |||
410 | adev->ddev->mode_config.funcs = &amdgpu_mode_funcs; | 406 | adev->ddev->mode_config.funcs = &amdgpu_mode_funcs; |
411 | 407 | ||
412 | adev->ddev->mode_config.max_width = 16384; | 408 | adev->ddev->mode_config.max_width = 16384; |
@@ -655,7 +651,6 @@ static enum hrtimer_restart dce_virtual_vblank_timer_handle(struct hrtimer *vbla | |||
655 | struct amdgpu_mode_info *mode_info = container_of(vblank_timer, struct amdgpu_mode_info ,vblank_timer); | 651 | struct amdgpu_mode_info *mode_info = container_of(vblank_timer, struct amdgpu_mode_info ,vblank_timer); |
656 | struct amdgpu_device *adev = container_of(mode_info, struct amdgpu_device ,mode_info); | 652 | struct amdgpu_device *adev = container_of(mode_info, struct amdgpu_device ,mode_info); |
657 | unsigned crtc = 0; | 653 | unsigned crtc = 0; |
658 | adev->ddev->vblank[0].count++; | ||
659 | drm_handle_vblank(adev->ddev, crtc); | 654 | drm_handle_vblank(adev->ddev, crtc); |
660 | dce_virtual_pageflip_irq(adev, NULL, NULL); | 655 | dce_virtual_pageflip_irq(adev, NULL, NULL); |
661 | hrtimer_start(vblank_timer, ktime_set(0, DCE_VIRTUAL_VBLANK_PERIOD), HRTIMER_MODE_REL); | 656 | hrtimer_start(vblank_timer, ktime_set(0, DCE_VIRTUAL_VBLANK_PERIOD), HRTIMER_MODE_REL); |
@@ -682,8 +677,6 @@ static void dce_virtual_set_crtc_vblank_interrupt_state(struct amdgpu_device *ad | |||
682 | hrtimer_cancel(&adev->mode_info.vblank_timer); | 677 | hrtimer_cancel(&adev->mode_info.vblank_timer); |
683 | } | 678 | } |
684 | 679 | ||
685 | if (!state || (state && !adev->mode_info.vsync_timer_enabled)) | ||
686 | adev->ddev->vblank[0].count = 0; | ||
687 | adev->mode_info.vsync_timer_enabled = state; | 680 | adev->mode_info.vsync_timer_enabled = state; |
688 | DRM_DEBUG("[FM]set crtc %d vblank interrupt state %d\n", crtc, state); | 681 | DRM_DEBUG("[FM]set crtc %d vblank interrupt state %d\n", crtc, state); |
689 | } | 682 | } |
@@ -720,7 +713,6 @@ static int dce_virtual_crtc_irq(struct amdgpu_device *adev, | |||
720 | unsigned crtc = 0; | 713 | unsigned crtc = 0; |
721 | unsigned irq_type = AMDGPU_CRTC_IRQ_VBLANK1; | 714 | unsigned irq_type = AMDGPU_CRTC_IRQ_VBLANK1; |
722 | 715 | ||
723 | adev->ddev->vblank[crtc].count++; | ||
724 | dce_virtual_crtc_vblank_int_ack(adev, crtc); | 716 | dce_virtual_crtc_vblank_int_ack(adev, crtc); |
725 | 717 | ||
726 | if (amdgpu_irq_enabled(adev, source, irq_type)) { | 718 | if (amdgpu_irq_enabled(adev, source, irq_type)) { |