aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-04-22 14:03:55 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 04:20:58 -0400
commita48b9b4edb8bb87deb13b9f088a595cf71457b69 (patch)
tree2cfe4156f911042a6c3943ee98503d452941dd92 /drivers/gpu/drm/radeon/radeon.h
parentbae6b5627387a950a8faf366d6027bd0a7a93078 (diff)
drm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)
This also simplifies the code and enables reclocking with multiple heads active by tracking whether the power states are single or multi-head capable. Eventually, we will want to select a power state based on external factors (AC/DC state, user selection, etc.). (v2) Update for evergreen Signed-off-by: Alex Deucher <alexdeucher@gmail.com> 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.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 11fe1d1444c..b5eccc4094e 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -672,6 +672,9 @@ struct radeon_pm_clock_info {
672 u32 flags; 672 u32 flags;
673}; 673};
674 674
675/* state flags */
676#define RADEON_PM_SINGLE_DISPLAY_ONLY (1 << 0)
677
675struct radeon_power_state { 678struct radeon_power_state {
676 enum radeon_pm_state_type type; 679 enum radeon_pm_state_type type;
677 /* XXX: use a define for num clock modes */ 680 /* XXX: use a define for num clock modes */
@@ -682,6 +685,8 @@ struct radeon_power_state {
682 /* non clock info about this state */ 685 /* non clock info about this state */
683 struct radeon_pm_non_clock_info non_clock_info; 686 struct radeon_pm_non_clock_info non_clock_info;
684 bool voltage_drop_active; 687 bool voltage_drop_active;
688 /* standardized state flags */
689 u32 flags;
685}; 690};
686 691
687/* 692/*
@@ -695,8 +700,10 @@ struct radeon_pm {
695 enum radeon_pm_state state; 700 enum radeon_pm_state state;
696 enum radeon_pm_action planned_action; 701 enum radeon_pm_action planned_action;
697 unsigned long action_timeout; 702 unsigned long action_timeout;
698 bool downclocked; 703 bool can_upclock;
699 int active_crtcs; 704 bool can_downclock;
705 u32 active_crtcs;
706 int active_crtc_count;
700 int req_vblank; 707 int req_vblank;
701 bool vblank_sync; 708 bool vblank_sync;
702 bool gui_idle; 709 bool gui_idle;
@@ -716,11 +723,13 @@ struct radeon_pm {
716 struct radeon_power_state power_state[8]; 723 struct radeon_power_state power_state[8];
717 /* number of valid power states */ 724 /* number of valid power states */
718 int num_power_states; 725 int num_power_states;
719 struct radeon_power_state *current_power_state; 726 int current_power_state_index;
720 struct radeon_pm_clock_info *current_clock_mode; 727 int current_clock_mode_index;
721 struct radeon_power_state *requested_power_state; 728 int requested_power_state_index;
722 struct radeon_pm_clock_info *requested_clock_mode; 729 int requested_clock_mode_index;
723 struct radeon_power_state *default_power_state; 730 int default_power_state_index;
731 u32 current_sclk;
732 u32 current_mclk;
724 struct radeon_i2c_chan *i2c_bus; 733 struct radeon_i2c_chan *i2c_bus;
725}; 734};
726 735
@@ -810,6 +819,7 @@ struct radeon_asic {
810 */ 819 */
811 void (*ioctl_wait_idle)(struct radeon_device *rdev, struct radeon_bo *bo); 820 void (*ioctl_wait_idle)(struct radeon_device *rdev, struct radeon_bo *bo);
812 bool (*gui_idle)(struct radeon_device *rdev); 821 bool (*gui_idle)(struct radeon_device *rdev);
822 void (*get_power_state)(struct radeon_device *rdev, enum radeon_pm_action action);
813 void (*set_power_state)(struct radeon_device *rdev); 823 void (*set_power_state)(struct radeon_device *rdev);
814}; 824};
815 825
@@ -1218,6 +1228,7 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
1218#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd)) 1228#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))
1219#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd)) 1229#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd))
1220#define radeon_gui_idle(rdev) (rdev)->asic->gui_idle((rdev)) 1230#define radeon_gui_idle(rdev) (rdev)->asic->gui_idle((rdev))
1231#define radeon_get_power_state(rdev, a) (rdev)->asic->get_power_state((rdev), (a))
1221#define radeon_set_power_state(rdev) (rdev)->asic->set_power_state((rdev)) 1232#define radeon_set_power_state(rdev) (rdev)->asic->set_power_state((rdev))
1222 1233
1223/* Common functions */ 1234/* Common functions */