aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-11-21 10:59:01 -0500
committerDave Airlie <airlied@redhat.com>2010-11-21 20:51:08 -0500
commit6f34be50bd1bdd2ff3c955940e033a80d05f248a (patch)
tree7e9635a2e589cd3a49490a4656611c112e485059 /drivers/gpu/drm/radeon/radeon.h
parentf5a8020903932624cf020dc72455a10a3e005087 (diff)
drm/radeon/kms: add pageflip ioctl support (v3)
This adds support for dri2 pageflipping. v2: precision updates from Mario Kleiner. v3: Multihead fixes from Mario Kleiner; missing crtc offset add note about update pending bit on pre-avivo chips Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 3a7095743d44..ddf1eca13401 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
381struct 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
391struct r500_irq_stat_regs {
392 u32 disp_int;
393};
394
395struct 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
403struct 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
418union 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
380struct radeon_irq { 424struct 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
397int radeon_irq_kms_init(struct radeon_device *rdev); 445int radeon_irq_kms_init(struct radeon_device *rdev);
398void radeon_irq_kms_fini(struct radeon_device *rdev); 446void radeon_irq_kms_fini(struct radeon_device *rdev);
399void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev); 447void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev);
400void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev); 448void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev);
449void radeon_irq_kms_pflip_irq_get(struct radeon_device *rdev, int crtc);
450void 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 */