aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-04-22 12:39:58 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 04:20:47 -0400
commitdef9ba9cf6a8266ee1ffd72556db002c3a2663db (patch)
tree4fff0f90b886dcfd96f11853cf4c605b2d3b759f /drivers/gpu/drm/radeon
parent1d42bbc8f7f9ce4d852692ef7aa336b133b0830a (diff)
drm/radeon/kms: add gui_idle callback
Check to see if the GUI engine and related blocks (2D, 3D, CP, etc) are idle or not. There are a number of cases when we need to know if the drawing engine is busy. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/r100.c8
-rw-r--r--drivers/gpu/drm/radeon/r600.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon.h2
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c14
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h2
5 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 9bdccb96499..e62116e222a 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -67,6 +67,14 @@ MODULE_FIRMWARE(FIRMWARE_R520);
67 * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 67 * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280
68 */ 68 */
69 69
70bool r100_gui_idle(struct radeon_device *rdev)
71{
72 if (RREG32(RADEON_RBBM_STATUS) & RADEON_RBBM_ACTIVE)
73 return false;
74 else
75 return true;
76}
77
70/* hpd for digital panel detect/disconnect */ 78/* hpd for digital panel detect/disconnect */
71bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd) 79bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
72{ 80{
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 2ec423c3f3f..1c85dcb168a 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -92,6 +92,14 @@ void r600_gpu_init(struct radeon_device *rdev);
92void r600_fini(struct radeon_device *rdev); 92void r600_fini(struct radeon_device *rdev);
93void r600_irq_disable(struct radeon_device *rdev); 93void r600_irq_disable(struct radeon_device *rdev);
94 94
95bool r600_gui_idle(struct radeon_device *rdev)
96{
97 if (RREG32(GRBM_STATUS) & GUI_ACTIVE)
98 return false;
99 else
100 return true;
101}
102
95/* hpd for digital panel detect/disconnect */ 103/* hpd for digital panel detect/disconnect */
96bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd) 104bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
97{ 105{
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index ab29d972a16..bb4a2a66f07 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -803,6 +803,7 @@ struct radeon_asic {
803 * through ring. 803 * through ring.
804 */ 804 */
805 void (*ioctl_wait_idle)(struct radeon_device *rdev, struct radeon_bo *bo); 805 void (*ioctl_wait_idle)(struct radeon_device *rdev, struct radeon_bo *bo);
806 bool (*gui_idle)(struct radeon_device *rdev);
806}; 807};
807 808
808/* 809/*
@@ -1209,6 +1210,7 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
1209#define radeon_hpd_fini(rdev) (rdev)->asic->hpd_fini((rdev)) 1210#define radeon_hpd_fini(rdev) (rdev)->asic->hpd_fini((rdev))
1210#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd)) 1211#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))
1211#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd)) 1212#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd))
1213#define radeon_gui_idle(rdev) (rdev)->asic->gui_idle((rdev))
1212 1214
1213/* Common functions */ 1215/* Common functions */
1214/* AGP */ 1216/* AGP */
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index f835333c1b6..42708462fd4 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -165,6 +165,7 @@ static struct radeon_asic r100_asic = {
165 .hpd_sense = &r100_hpd_sense, 165 .hpd_sense = &r100_hpd_sense,
166 .hpd_set_polarity = &r100_hpd_set_polarity, 166 .hpd_set_polarity = &r100_hpd_set_polarity,
167 .ioctl_wait_idle = NULL, 167 .ioctl_wait_idle = NULL,
168 .gui_idle = &r100_gui_idle,
168}; 169};
169 170
170static struct radeon_asic r200_asic = { 171static struct radeon_asic r200_asic = {
@@ -203,6 +204,7 @@ static struct radeon_asic r200_asic = {
203 .hpd_sense = &r100_hpd_sense, 204 .hpd_sense = &r100_hpd_sense,
204 .hpd_set_polarity = &r100_hpd_set_polarity, 205 .hpd_set_polarity = &r100_hpd_set_polarity,
205 .ioctl_wait_idle = NULL, 206 .ioctl_wait_idle = NULL,
207 .gui_idle = &r100_gui_idle,
206}; 208};
207 209
208static struct radeon_asic r300_asic = { 210static struct radeon_asic r300_asic = {
@@ -242,6 +244,7 @@ static struct radeon_asic r300_asic = {
242 .hpd_sense = &r100_hpd_sense, 244 .hpd_sense = &r100_hpd_sense,
243 .hpd_set_polarity = &r100_hpd_set_polarity, 245 .hpd_set_polarity = &r100_hpd_set_polarity,
244 .ioctl_wait_idle = NULL, 246 .ioctl_wait_idle = NULL,
247 .gui_idle = &r100_gui_idle,
245}; 248};
246 249
247static struct radeon_asic r300_asic_pcie = { 250static struct radeon_asic r300_asic_pcie = {
@@ -280,6 +283,7 @@ static struct radeon_asic r300_asic_pcie = {
280 .hpd_sense = &r100_hpd_sense, 283 .hpd_sense = &r100_hpd_sense,
281 .hpd_set_polarity = &r100_hpd_set_polarity, 284 .hpd_set_polarity = &r100_hpd_set_polarity,
282 .ioctl_wait_idle = NULL, 285 .ioctl_wait_idle = NULL,
286 .gui_idle = &r100_gui_idle,
283}; 287};
284 288
285static struct radeon_asic r420_asic = { 289static struct radeon_asic r420_asic = {
@@ -319,6 +323,7 @@ static struct radeon_asic r420_asic = {
319 .hpd_sense = &r100_hpd_sense, 323 .hpd_sense = &r100_hpd_sense,
320 .hpd_set_polarity = &r100_hpd_set_polarity, 324 .hpd_set_polarity = &r100_hpd_set_polarity,
321 .ioctl_wait_idle = NULL, 325 .ioctl_wait_idle = NULL,
326 .gui_idle = &r100_gui_idle,
322}; 327};
323 328
324static struct radeon_asic rs400_asic = { 329static struct radeon_asic rs400_asic = {
@@ -358,6 +363,7 @@ static struct radeon_asic rs400_asic = {
358 .hpd_sense = &r100_hpd_sense, 363 .hpd_sense = &r100_hpd_sense,
359 .hpd_set_polarity = &r100_hpd_set_polarity, 364 .hpd_set_polarity = &r100_hpd_set_polarity,
360 .ioctl_wait_idle = NULL, 365 .ioctl_wait_idle = NULL,
366 .gui_idle = &r100_gui_idle,
361}; 367};
362 368
363static struct radeon_asic rs600_asic = { 369static struct radeon_asic rs600_asic = {
@@ -397,6 +403,7 @@ static struct radeon_asic rs600_asic = {
397 .hpd_sense = &rs600_hpd_sense, 403 .hpd_sense = &rs600_hpd_sense,
398 .hpd_set_polarity = &rs600_hpd_set_polarity, 404 .hpd_set_polarity = &rs600_hpd_set_polarity,
399 .ioctl_wait_idle = NULL, 405 .ioctl_wait_idle = NULL,
406 .gui_idle = &r100_gui_idle,
400}; 407};
401 408
402static struct radeon_asic rs690_asic = { 409static struct radeon_asic rs690_asic = {
@@ -436,6 +443,7 @@ static struct radeon_asic rs690_asic = {
436 .hpd_sense = &rs600_hpd_sense, 443 .hpd_sense = &rs600_hpd_sense,
437 .hpd_set_polarity = &rs600_hpd_set_polarity, 444 .hpd_set_polarity = &rs600_hpd_set_polarity,
438 .ioctl_wait_idle = NULL, 445 .ioctl_wait_idle = NULL,
446 .gui_idle = &r100_gui_idle,
439}; 447};
440 448
441static struct radeon_asic rv515_asic = { 449static struct radeon_asic rv515_asic = {
@@ -475,6 +483,7 @@ static struct radeon_asic rv515_asic = {
475 .hpd_sense = &rs600_hpd_sense, 483 .hpd_sense = &rs600_hpd_sense,
476 .hpd_set_polarity = &rs600_hpd_set_polarity, 484 .hpd_set_polarity = &rs600_hpd_set_polarity,
477 .ioctl_wait_idle = NULL, 485 .ioctl_wait_idle = NULL,
486 .gui_idle = &r100_gui_idle,
478}; 487};
479 488
480static struct radeon_asic r520_asic = { 489static struct radeon_asic r520_asic = {
@@ -514,6 +523,7 @@ static struct radeon_asic r520_asic = {
514 .hpd_sense = &rs600_hpd_sense, 523 .hpd_sense = &rs600_hpd_sense,
515 .hpd_set_polarity = &rs600_hpd_set_polarity, 524 .hpd_set_polarity = &rs600_hpd_set_polarity,
516 .ioctl_wait_idle = NULL, 525 .ioctl_wait_idle = NULL,
526 .gui_idle = &r100_gui_idle,
517}; 527};
518 528
519static struct radeon_asic r600_asic = { 529static struct radeon_asic r600_asic = {
@@ -552,6 +562,7 @@ static struct radeon_asic r600_asic = {
552 .hpd_sense = &r600_hpd_sense, 562 .hpd_sense = &r600_hpd_sense,
553 .hpd_set_polarity = &r600_hpd_set_polarity, 563 .hpd_set_polarity = &r600_hpd_set_polarity,
554 .ioctl_wait_idle = r600_ioctl_wait_idle, 564 .ioctl_wait_idle = r600_ioctl_wait_idle,
565 .gui_idle = &r600_gui_idle,
555}; 566};
556 567
557static struct radeon_asic rs780_asic = { 568static struct radeon_asic rs780_asic = {
@@ -590,6 +601,7 @@ static struct radeon_asic rs780_asic = {
590 .hpd_sense = &r600_hpd_sense, 601 .hpd_sense = &r600_hpd_sense,
591 .hpd_set_polarity = &r600_hpd_set_polarity, 602 .hpd_set_polarity = &r600_hpd_set_polarity,
592 .ioctl_wait_idle = r600_ioctl_wait_idle, 603 .ioctl_wait_idle = r600_ioctl_wait_idle,
604 .gui_idle = &r600_gui_idle,
593}; 605};
594 606
595static struct radeon_asic rv770_asic = { 607static struct radeon_asic rv770_asic = {
@@ -628,6 +640,7 @@ static struct radeon_asic rv770_asic = {
628 .hpd_sense = &r600_hpd_sense, 640 .hpd_sense = &r600_hpd_sense,
629 .hpd_set_polarity = &r600_hpd_set_polarity, 641 .hpd_set_polarity = &r600_hpd_set_polarity,
630 .ioctl_wait_idle = r600_ioctl_wait_idle, 642 .ioctl_wait_idle = r600_ioctl_wait_idle,
643 .gui_idle = &r600_gui_idle,
631}; 644};
632 645
633static struct radeon_asic evergreen_asic = { 646static struct radeon_asic evergreen_asic = {
@@ -664,6 +677,7 @@ static struct radeon_asic evergreen_asic = {
664 .hpd_fini = &evergreen_hpd_fini, 677 .hpd_fini = &evergreen_hpd_fini,
665 .hpd_sense = &evergreen_hpd_sense, 678 .hpd_sense = &evergreen_hpd_sense,
666 .hpd_set_polarity = &evergreen_hpd_set_polarity, 679 .hpd_set_polarity = &evergreen_hpd_set_polarity,
680 .gui_idle = &r600_gui_idle,
667}; 681};
668 682
669int radeon_asic_init(struct radeon_device *rdev) 683int radeon_asic_init(struct radeon_device *rdev)
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index ef2c7ba1bdc..c74bf9bd26c 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -126,6 +126,7 @@ int r100_cs_packet_parse(struct radeon_cs_parser *p,
126void r100_enable_bm(struct radeon_device *rdev); 126void r100_enable_bm(struct radeon_device *rdev);
127void r100_set_common_regs(struct radeon_device *rdev); 127void r100_set_common_regs(struct radeon_device *rdev);
128void r100_bm_disable(struct radeon_device *rdev); 128void r100_bm_disable(struct radeon_device *rdev);
129extern bool r100_gui_idle(struct radeon_device *rdev);
129/* 130/*
130 * r200,rv250,rs300,rv280 131 * r200,rv250,rs300,rv280
131 */ 132 */
@@ -269,6 +270,7 @@ bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
269void r600_hpd_set_polarity(struct radeon_device *rdev, 270void r600_hpd_set_polarity(struct radeon_device *rdev,
270 enum radeon_hpd_id hpd); 271 enum radeon_hpd_id hpd);
271extern void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo); 272extern void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo);
273extern bool r600_gui_idle(struct radeon_device *rdev);
272 274
273/* 275/*
274 * rv770,rv730,rv710,rv740 276 * rv770,rv730,rv710,rv740