diff options
author | Dave Airlie <airlied@redhat.com> | 2010-12-02 23:00:52 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-12-02 23:00:52 -0500 |
commit | 7e76c5cf6f4dbfb18325de5408c0ac8d3f271d85 (patch) | |
tree | 55986f85c5688906ef02da13ae589ab69d661166 /drivers/gpu/drm/radeon/radeon.h | |
parent | a9979d6077e4482dbe64cedc4bb181d5576d13f7 (diff) | |
parent | acb325062afc09c196f7d3888b81312e6ebcdc35 (diff) |
Merge branch 'drm-radeon-next' of ../drm-radeon-next into drm-core-next
* 'drm-radeon-next' of ../drm-radeon-next:
drm/radeon/kms: improve pflip precision on r1xx-r4xx
drm/kms/radeon: Use high precision timestamps for pageflip completion events.
drm/kms/radeon: Reorder vblank and pageflip interrupt handling.
drm/radeon/kms: add pageflip ioctl support (v3)
drm/kms/radeon: Add support for precise vblank timestamping.
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index b1e073b7381f..5827a71e4094 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -377,11 +377,56 @@ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg); | |||
377 | /* | 377 | /* |
378 | * IRQS. | 378 | * IRQS. |
379 | */ | 379 | */ |
380 | |||
381 | struct radeon_unpin_work { | ||
382 | struct work_struct work; | ||
383 | struct radeon_device *rdev; | ||
384 | int crtc_id; | ||
385 | struct radeon_fence *fence; | ||
386 | struct drm_pending_vblank_event *event; | ||
387 | struct radeon_bo *old_rbo; | ||
388 | u64 new_crtc_base; | ||
389 | }; | ||
390 | |||
391 | struct r500_irq_stat_regs { | ||
392 | u32 disp_int; | ||
393 | }; | ||
394 | |||
395 | struct r600_irq_stat_regs { | ||
396 | u32 disp_int; | ||
397 | u32 disp_int_cont; | ||
398 | u32 disp_int_cont2; | ||
399 | u32 d1grph_int; | ||
400 | u32 d2grph_int; | ||
401 | }; | ||
402 | |||
403 | struct evergreen_irq_stat_regs { | ||
404 | u32 disp_int; | ||
405 | u32 disp_int_cont; | ||
406 | u32 disp_int_cont2; | ||
407 | u32 disp_int_cont3; | ||
408 | u32 disp_int_cont4; | ||
409 | u32 disp_int_cont5; | ||
410 | u32 d1grph_int; | ||
411 | u32 d2grph_int; | ||
412 | u32 d3grph_int; | ||
413 | u32 d4grph_int; | ||
414 | u32 d5grph_int; | ||
415 | u32 d6grph_int; | ||
416 | }; | ||
417 | |||
418 | union radeon_irq_stat_regs { | ||
419 | struct r500_irq_stat_regs r500; | ||
420 | struct r600_irq_stat_regs r600; | ||
421 | struct evergreen_irq_stat_regs evergreen; | ||
422 | }; | ||
423 | |||
380 | struct radeon_irq { | 424 | struct radeon_irq { |
381 | bool installed; | 425 | bool installed; |
382 | bool sw_int; | 426 | bool sw_int; |
383 | /* FIXME: use a define max crtc rather than hardcode it */ | 427 | /* FIXME: use a define max crtc rather than hardcode it */ |
384 | bool crtc_vblank_int[6]; | 428 | bool crtc_vblank_int[6]; |
429 | bool pflip[6]; | ||
385 | wait_queue_head_t vblank_queue; | 430 | wait_queue_head_t vblank_queue; |
386 | /* FIXME: use defines for max hpd/dacs */ | 431 | /* FIXME: use defines for max hpd/dacs */ |
387 | bool hpd[6]; | 432 | bool hpd[6]; |
@@ -392,12 +437,17 @@ struct radeon_irq { | |||
392 | bool hdmi[2]; | 437 | bool hdmi[2]; |
393 | spinlock_t sw_lock; | 438 | spinlock_t sw_lock; |
394 | int sw_refcount; | 439 | int sw_refcount; |
440 | union radeon_irq_stat_regs stat_regs; | ||
441 | spinlock_t pflip_lock[6]; | ||
442 | int pflip_refcount[6]; | ||
395 | }; | 443 | }; |
396 | 444 | ||
397 | int radeon_irq_kms_init(struct radeon_device *rdev); | 445 | int radeon_irq_kms_init(struct radeon_device *rdev); |
398 | void radeon_irq_kms_fini(struct radeon_device *rdev); | 446 | void radeon_irq_kms_fini(struct radeon_device *rdev); |
399 | void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev); | 447 | void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev); |
400 | void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev); | 448 | void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev); |
449 | void radeon_irq_kms_pflip_irq_get(struct radeon_device *rdev, int crtc); | ||
450 | void radeon_irq_kms_pflip_irq_put(struct radeon_device *rdev, int crtc); | ||
401 | 451 | ||
402 | /* | 452 | /* |
403 | * CP & ring. | 453 | * CP & ring. |
@@ -881,6 +931,10 @@ struct radeon_asic { | |||
881 | void (*pm_finish)(struct radeon_device *rdev); | 931 | void (*pm_finish)(struct radeon_device *rdev); |
882 | void (*pm_init_profile)(struct radeon_device *rdev); | 932 | void (*pm_init_profile)(struct radeon_device *rdev); |
883 | void (*pm_get_dynpm_state)(struct radeon_device *rdev); | 933 | void (*pm_get_dynpm_state)(struct radeon_device *rdev); |
934 | /* pageflipping */ | ||
935 | void (*pre_page_flip)(struct radeon_device *rdev, int crtc); | ||
936 | u32 (*page_flip)(struct radeon_device *rdev, int crtc, u64 crtc_base); | ||
937 | void (*post_page_flip)(struct radeon_device *rdev, int crtc); | ||
884 | }; | 938 | }; |
885 | 939 | ||
886 | /* | 940 | /* |
@@ -1344,6 +1398,9 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) | |||
1344 | #define radeon_pm_finish(rdev) (rdev)->asic->pm_finish((rdev)) | 1398 | #define radeon_pm_finish(rdev) (rdev)->asic->pm_finish((rdev)) |
1345 | #define radeon_pm_init_profile(rdev) (rdev)->asic->pm_init_profile((rdev)) | 1399 | #define radeon_pm_init_profile(rdev) (rdev)->asic->pm_init_profile((rdev)) |
1346 | #define radeon_pm_get_dynpm_state(rdev) (rdev)->asic->pm_get_dynpm_state((rdev)) | 1400 | #define radeon_pm_get_dynpm_state(rdev) (rdev)->asic->pm_get_dynpm_state((rdev)) |
1401 | #define radeon_pre_page_flip(rdev, crtc) rdev->asic->pre_page_flip((rdev), (crtc)) | ||
1402 | #define radeon_page_flip(rdev, crtc, base) rdev->asic->page_flip((rdev), (crtc), (base)) | ||
1403 | #define radeon_post_page_flip(rdev, crtc) rdev->asic->post_page_flip((rdev), (crtc)) | ||
1347 | 1404 | ||
1348 | /* Common functions */ | 1405 | /* Common functions */ |
1349 | /* AGP */ | 1406 | /* AGP */ |