radeon kms pm patches
PATCH 1/1 radeon kms pm patches
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
So far I haven't seen any corruption when changing power modes.
What the patches do:
- implement gui idle irq support
- only change clocks when the engine is idle
- add support for turning down the number of active simds in lower power modes (r6xx+)
- add a pm_fini function
- move set/get power state logic into asic specific callbacks. Different strategies for handling
different power tables formats.
Things left to do:
- reset clocks to default on module unload (in pm_fini function)
- add request module support for hwmon i2c thermal chip drivers
- add hwmon support for internal thermal/fan support used on some r6xx/r7xx boards
- add more robust power state selection
- tie power state selection into external events (manual power mode selection, AC/DC state, etc.)
- hook up memory reclocking
- hook up pcie lane setting
- hook up voltage setting
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
2010/3/15 Alex Deucher <[email protected]>:
Quoted 8 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/So far I haven't seen any corruption when changing power modes.
Why don't you post them inline? It would be possible to comment any part of code.
1) What is GUI?
2) What is SIMD?
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Rafał Miłecki <[email protected]>:
Quoted 8 lines
2010/3/15 Alex Deucher <[email protected]>:
Quoted 7 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
Quoted 4 lines
Quoted 1 line
So far I haven't seen any corruption when changing power modes.
Why don't you post them inline? It would be possible to comment any part of code.
It was a lot of patches. I can post them with the message next time.
Quoted 2 lines
1) What is GUI?
Graphical User Interface. In this case it refers to the drawing engine and related blocks (2D, 3D, CP, etc.).
Quoted 1 line
2) What is SIMD?
SIMD (Single Instruction Multiple Data) blocks are the computational blocks of the shader engine.
Alex
Quoted 4 lines
--
Rafał
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
Code you removed was needed for PM debugfs, to do not display memory clock on IGP
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Rafał Miłecki <[email protected]>:
Quoted 8 lines
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
Quoted 4 lines
Code you removed was needed for PM debugfs, to do not display memory clock on IGP
Oh, right... debugfs support is also currently broken with multiple cards. I'll just drop this patch for now.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
You made same mistake I did earlier with "0" argument in condition.
You should use same trick as I did in:
http://people.freedesktop.org/~agd5f/pm2/0013-drm-radeon-kms-switch-to-condition-waiting-for-recl.patch
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Rafał Miłecki <[email protected]>:
Quoted 8 lines
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
Quoted 6 lines
You made same mistake I did earlier with "0" argument in condition.
You should use same trick as I did in:
http://people.freedesktop.org/~agd5f/pm2/0013-drm-radeon-kms-switch-to-condition-waiting-for-recl.patch
Good catch! fixed.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
You can consider porting
[PATCH 2/2] drm/radeon/kms: prepare for more reclocking operations
You will need to sync with VBLANK few times I believe.
Not sure about GUI syncing, do not know what is this.
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Rafał Miłecki <[email protected]>:
Quoted 8 lines
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
Quoted 6 lines
You can consider porting
[PATCH 2/2] drm/radeon/kms: prepare for more reclocking operationsYou will need to sync with VBLANK few times I believe.
Not sure about GUI syncing, do not know what is this.
I've gone ahead and rebased my patches against Dave's current drm-radeon-testing branch, so both patches should be in now.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
http://people.freedesktop.org/~agd5f/pm2/0009-drm-radeon-kms-r6xx-enable-simd-pm.patch
Didn't you miss there something actually *setting* SIMD(s?)?
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/15 Rafał Miłecki <[email protected]>:
Quoted 11 lines
2010/3/15 Alex Deucher <[email protected]>:
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/http://people.freedesktop.org/~agd5f/pm2/0009-drm-radeon-kms-r6xx-enable-simd-pm.patch
Didn't you miss there something actually *setting* SIMD(s?)?
heh... whoops. fixed.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 6 lines · Alex Deucher
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/
Updated patches rebased against airlied's new drm-radeon-testing along with the fixes noted in Rafal's comments:
http://people.freedesktop.org/~agd5f/pm2/
Alex
Quoted 25 lines
So far I haven't seen any corruption when changing power modes.
What the patches do:
- implement gui idle irq support
- only change clocks when the engine is idle
- add support for turning down the number of active simds in lower power modes (r6xx+)
- add apm_finifunction
- move set/get power state logic into asic specific callbacks. Different strategies for handling
different power tables formats.Things left to do:
- reset clocks to default on module unload (inpm_finifunction)
- add request module support for hwmon i2c thermal chip drivers
- add hwmon support for internal thermal/fan support used on some r6xx/r7xx boards
- add more robust power state selection
- tie power state selection into external events (manual power mode selection, AC/DC state, etc.)
- hook up memory reclocking
- hook up pcie lane setting
- hook up voltage setting
Quoted 2 lines
Alex
From b4880d6cb8d7913bf177c463cc8ffce8a2c1785a Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 01:36:32 -0400
Subject: [PATCH] drm/radeon/kms/pm: fix typo in power table parsing
--- drivers/gpu/drm/radeon/radeon_atombios.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +1 -1
@@ -1734,7 +1734,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)/* add the i2c bus for thermal/fan chip */ /* no support for internal controller yet */ if (power_info->info_4.sThermalController.ucType >0 ) { -if ((power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) && +if ((power_info->info_4.sThermalController.ucType == ATOM_PP_THERMALCONTROLLER_RV6xx) || (power_info->info_4.sThermalController.ucType ==ATOM_PP_THERMALCONTROLLER_RV770 )) { DRM_INFO("Internal thermal controller %s fan control\n", (power_info->info_4.sThermalController.ucFanParameters &
Signature · 1 line
1.5.6.3
From 8a7870eafff76d64c22214eca3d9033c74669478 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 5 Mar 2010 14:50:37 -0500
Subject: [PATCH] drm/radeon/kms: gfx init fixes for r6xx/r7xx
This fixes some issues with the last gfx init patch.
--- drivers/gpu/drm/radeon/r600.c | 1 + drivers/gpu/drm/radeon/r600_cp.c | 3 +++ drivers/gpu/drm/radeon/rv770.c | 3 +++ 3 files changed, 7 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +1 -0
@@ -1116,6 +1116,7 @@ void r600_gpu_init(struct radeon_device *rdev)/* Setup pipes */ WREG32 (CC_RB_BACKEND_DISABLE , cc_rb_backend_disable);WREG32 (CC_GC_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config); +WREG32 (GC_USER_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config); tmp =R6XX_MAX_PIPES -r600_count_pipe_bits ((cc_gc_shader_pipe_config &INACTIVE_QD_PIPES_MASK ) >>8 );WREG32 (VGT_OUT_DEALLOC_CNTL , (tmp *4 ) &DEALLOC_DIST_MASK );
drivers/gpu/drm/radeon/r600_cp.c +3 -0
@@ -1548,10 +1548,13 @@ static void r700_gfx_init(struct drm_device *dev,RADEON_WRITE (R600_CC_RB_BACKEND_DISABLE , cc_rb_backend_disable);RADEON_WRITE (R600_CC_GC_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config); +RADEON_WRITE (R600_GC_USER_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config);RADEON_WRITE (R700_CC_SYS_RB_BACKEND_DISABLE , cc_rb_backend_disable);RADEON_WRITE (R700_CGTS_SYS_TCC_DISABLE ,0 );RADEON_WRITE (R700_CGTS_TCC_DISABLE ,0 ); +RADEON_WRITE (R700_CGTS_USER_SYS_TCC_DISABLE ,0 ); +RADEON_WRITE (R700_CGTS_USER_TCC_DISABLE ,0 ); num_qd_pipes =R7XX_MAX_PIPES -r600_count_pipe_bits ((cc_gc_shader_pipe_config &R600_INACTIVE_QD_PIPES_MASK ) >>8 );
drivers/gpu/drm/radeon/rv770.c +3 -0
@@ -648,10 +648,13 @@ static void rv770_gpu_init(struct radeon_device *rdev)WREG32 (CC_RB_BACKEND_DISABLE , cc_rb_backend_disable);WREG32 (CC_GC_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config); +WREG32 (GC_USER_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config);WREG32 (CC_SYS_RB_BACKEND_DISABLE , cc_rb_backend_disable);WREG32 (CGTS_SYS_TCC_DISABLE ,0 );WREG32 (CGTS_TCC_DISABLE ,0 ); +WREG32 (CGTS_USER_SYS_TCC_DISABLE ,0 ); +WREG32 (CGTS_USER_TCC_DISABLE ,0 ); num_qd_pipes =R7XX_MAX_PIPES -r600_count_pipe_bits ((cc_gc_shader_pipe_config &INACTIVE_QD_PIPES_MASK ) >>8 );
Signature · 1 line
1.5.6.3
From ba26fd0f8d8a42e9fb5074c401799da4ca019e5f Mon Sep 17 00:00:00 2001
From: Jean Delvare <[email protected]>
Date: Sat, 13 Mar 2010 17:47:57 +0100
Subject: [PATCH] i2c-algo-bit: Add pre- and post-xfer hooks
Drivers might have to do random things before and/or after I2C transfers. Add hooks to the i2c-algo-bit implementation to let them do so.
--- drivers/i2c/algos/i2c-algo-bit.c | 9 +++++++++ include/linux/i2c-algo-bit.h | 2 ++ 2 files changed, 11 insertions(+), 0 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +9 -0
@@ -522,6 +522,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,int i, ret;unsigned short nak_ok; +if (adap->pre_xfer) { + ret = adap->pre_xfer (i2c_adap); +if (ret <0 ) +return ret; + } +bit_dbg (3 , &i2c_adap->dev,"emitting start condition\n" );i2c_start (adap);for (i =0 ; i < num; i++) {
@@ -570,6 +576,9 @@ static int bit_xfer(struct i2c_adapter *i2c_adap, bailout:bit_dbg (3 , &i2c_adap->dev,"emitting stop condition\n" );i2c_stop (adap); + +if (adap->post_xfer) + adap->post_xfer (i2c_adap);return ret; }
include/linux/i2c-algo-bit.h +2 -0
@@ -36,6 +36,8 @@ struct i2c_algo_bit_data {void (*setscl) (void *data,int state);int (*getsda) (void *data);int (*getscl) (void *data); +int (*pre_xfer) (struct i2c_adapter *); +void (*post_xfer) (struct i2c_adapter *);/* local settings */ int udelay;/* half clock cycle time in us,
Signature · 1 line
1.5.6.3
From 4037236a25f35eb5b2133e66e72984590348b687 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 01:14:30 -0400
Subject: [PATCH] drm/radeon/kms: use new pre/post_xfer i2c bit algo hooks
This allows us to remove the internal bit algo bus used by the radeon i2c algo. We now register a radeon algo adapter if the gpio line is hw capable and the hw inplementation is available, otherwise we register a bit algo adapter.
--- drivers/gpu/drm/radeon/radeon_connectors.c | 2 +- drivers/gpu/drm/radeon/radeon_i2c.c | 133 +++++++++++++--------------- drivers/gpu/drm/radeon/radeon_mode.h | 8 +-- 3 files changed, 64 insertions(+), 79 deletions(-)
drivers/gpu/drm/radeon/radeon_connectors.c +1 -1
@@ -940,7 +940,7 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector)if (radeon_connector->edid)kfree (radeon_connector->edid);if (radeon_dig_connector->dp_i2c_bus) -radeon_i2c_destroy_dp (radeon_dig_connector->dp_i2c_bus); +radeon_i2c_destroy (radeon_dig_connector->dp_i2c_bus);kfree (radeon_connector->con_priv);drm_sysfs_connector_remove (connector);drm_connector_cleanup (connector);
drivers/gpu/drm/radeon/radeon_i2c.c +62 -71
223 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon_mode.h +1 -7
@@ -173,17 +173,12 @@ struct radeon_pll {enum radeon_pll_algo algo; }; -struct i2c_algo_radeon_data { -struct i2c_adapter bit_adapter; -struct i2c_algo_bit_data bit_data; -}; -struct radeon_i2c_chan {struct i2c_adapter adapter;struct drm_device *dev;union { +struct i2c_algo_bit_data bit;struct i2c_algo_dp_aux_data dp; -struct i2c_algo_radeon_data radeon; } algo;struct radeon_i2c_bus_rec rec; };
@@ -435,7 +430,6 @@ extern struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,struct radeon_i2c_bus_rec *rec, const char *name);extern void radeon_i2c_destroy (struct radeon_i2c_chan *i2c); -extern void radeon_i2c_destroy_dp (struct radeon_i2c_chan *i2c); extern void radeon_i2c_get_byte(struct radeon_i2c_chan *i2c_bus, u8 slave_addr, u8 addr,
Signature · 1 line
1.5.6.3
From 8ed3db86304d69214b3339e227217c9e94550eb7 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 02:38:38 -0400
Subject: [PATCH] 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.
--- drivers/gpu/drm/radeon/r100.c | 8 ++++++++ drivers/gpu/drm/radeon/r600.c | 8 ++++++++ drivers/gpu/drm/radeon/radeon.h | 2 ++ drivers/gpu/drm/radeon/radeon_asic.c | 13 +++++++++++++ drivers/gpu/drm/radeon/radeon_asic.h | 2 ++ 5 files changed, 33 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r100.c +8 -0
@@ -66,6 +66,14 @@ MODULE_FIRMWARE(FIRMWARE_R520);* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ +bool r100_gui_idle (struct radeon_device *rdev) +{ +if (RREG32 (RADEON_RBBM_STATUS ) &RADEON_RBBM_ACTIVE ) +return false; +else +return true; +} +/* hpd for digital panel detect/disconnect */ bool r100_hpd_sense (struct radeon_device *rdev,enum radeon_hpd_id hpd) {
drivers/gpu/drm/radeon/r600.c +8 -0
@@ -75,6 +75,14 @@ int r600_mc_wait_for_idle(struct radeon_device *rdev);void r600_gpu_init (struct radeon_device *rdev);void r600_fini (struct radeon_device *rdev); +bool r600_gui_idle (struct radeon_device *rdev) +{ +if (RREG32 (GRBM_STATUS ) &GUI_ACTIVE ) +return false; +else +return true; +} +/* hpd for digital panel detect/disconnect */ bool r600_hpd_sense (struct radeon_device *rdev,enum radeon_hpd_id hpd) {
drivers/gpu/drm/radeon/radeon.h +2 -0
@@ -798,6 +798,7 @@ struct radeon_asic {* through ring. */ void (*ioctl_wait_idle)(struct radeon_device *rdev,struct radeon_bo *bo); +bool (*gui_idle)(struct radeon_device *rdev); };/*
@@ -1182,6 +1183,7 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)#define radeon_hpd_fini (rdev) (rdev)->asic->hpd_fini((rdev))#define radeon_hpd_sense (rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))#define radeon_hpd_set_polarity (rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd)) +#define radeon_gui_idle (rdev) (rdev)->asic->gui_idle((rdev))/* Common functions */ /* AGP */
drivers/gpu/drm/radeon/radeon_asic.c +13 -0
@@ -165,6 +165,7 @@ static struct radeon_asic r100_asic = { .hpd_sense = &r100_hpd_sense, .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic r200_asic = {
@@ -203,6 +204,7 @@ static struct radeon_asic r200_asic = { .hpd_sense = &r100_hpd_sense, .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic r300_asic = {
@@ -242,6 +244,7 @@ static struct radeon_asic r300_asic = { .hpd_sense = &r100_hpd_sense, .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic r300_asic_pcie = {
@@ -280,6 +283,7 @@ static struct radeon_asic r300_asic_pcie = { .hpd_sense = &r100_hpd_sense, .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic r420_asic = {
@@ -319,6 +323,7 @@ static struct radeon_asic r420_asic = { .hpd_sense = &r100_hpd_sense, .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic rs400_asic = {
@@ -358,6 +363,7 @@ static struct radeon_asic rs400_asic = { .hpd_sense = &r100_hpd_sense, .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic rs600_asic = {
@@ -397,6 +403,7 @@ static struct radeon_asic rs600_asic = { .hpd_sense = &rs600_hpd_sense, .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic rs690_asic = {
@@ -436,6 +443,7 @@ static struct radeon_asic rs690_asic = { .hpd_sense = &rs600_hpd_sense, .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic rv515_asic = {
@@ -475,6 +483,7 @@ static struct radeon_asic rv515_asic = { .hpd_sense = &rs600_hpd_sense, .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic r520_asic = {
@@ -514,6 +523,7 @@ static struct radeon_asic r520_asic = { .hpd_sense = &rs600_hpd_sense, .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, + .gui_idle = &r100_gui_idle, };static struct radeon_asic r600_asic = {
@@ -552,6 +562,7 @@ static struct radeon_asic r600_asic = { .hpd_sense = &r600_hpd_sense, .hpd_set_polarity = &r600_hpd_set_polarity, .ioctl_wait_idle = r600_ioctl_wait_idle, + .gui_idle = &r600_gui_idle, };static struct radeon_asic rv770_asic = {
@@ -590,6 +601,7 @@ static struct radeon_asic rv770_asic = { .hpd_sense = &r600_hpd_sense, .hpd_set_polarity = &r600_hpd_set_polarity, .ioctl_wait_idle = r600_ioctl_wait_idle, + .gui_idle = &r600_gui_idle, };static struct radeon_asic evergreen_asic = {
@@ -626,6 +638,7 @@ static struct radeon_asic evergreen_asic = { .hpd_fini = &evergreen_hpd_fini, .hpd_sense = &evergreen_hpd_sense, .hpd_set_polarity = &evergreen_hpd_set_polarity, + .gui_idle = &r600_gui_idle, };int radeon_asic_init (struct radeon_device *rdev)
drivers/gpu/drm/radeon/radeon_asic.h +2 -0
@@ -126,6 +126,7 @@ int r100_cs_packet_parse(struct radeon_cs_parser *p,void r100_enable_bm (struct radeon_device *rdev);void r100_set_common_regs (struct radeon_device *rdev);void r100_bm_disable (struct radeon_device *rdev); +extern bool r100_gui_idle (struct radeon_device *rdev);/* * r200,rv250,rs300,rv280 */
@@ -269,6 +270,7 @@ bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);void r600_hpd_set_polarity (struct radeon_device *rdev,enum radeon_hpd_id hpd);extern void r600_ioctl_wait_idle (struct radeon_device *rdev,struct radeon_bo *bo); +extern bool r600_gui_idle (struct radeon_device *rdev);/* * rv770,rv730,rv710,rv740
Signature · 1 line
1.5.6.3
From 2642863476ad78ead5c8adb2da5901bc62e845e5 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 02:42:05 -0400
Subject: [PATCH] drm/radeon/kms: add support for gui idle interrupts
Useful for certain power management operations. You need to wait for the GUI engine (2D, 3D, CP, etc.) to be idle before changing clocks or adjusting engine parameters.
--- drivers/gpu/drm/radeon/r100.c | 6 +++++- drivers/gpu/drm/radeon/r600.c | 10 ++++++++++ drivers/gpu/drm/radeon/radeon.h | 2 ++ drivers/gpu/drm/radeon/radeon_device.c | 1 + drivers/gpu/drm/radeon/radeon_irq_kms.c | 1 + drivers/gpu/drm/radeon/radeon_reg.h | 3 +++ drivers/gpu/drm/radeon/rs600.c | 5 ++++- 7 files changed, 26 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/r100.c +5 -1
@@ -291,7 +291,7 @@ void r100_irq_disable(struct radeon_device *rdev)static inline uint32_t r100_irq_ack (struct radeon_device *rdev) {uint32_t irqs =RREG32 (RADEON_GEN_INT_STATUS ); -uint32_t irq_mask =RADEON_SW_INT_TEST | +uint32_t irq_mask =RADEON_SW_INT_TEST |RADEON_GUI_IDLE_STAT |RADEON_CRTC_VBLANK_STAT |RADEON_CRTC2_VBLANK_STAT |RADEON_FP_DETECT_STAT |RADEON_FP2_DETECT_STAT ;
@@ -318,6 +318,10 @@ int r100_irq_process(struct radeon_device *rdev)if (status &RADEON_SW_INT_TEST ) {radeon_fence_process (rdev); } +/* gui idle interrupt */ +if (status &RADEON_GUI_IDLE_STAT ) { +wake_up (&rdev->irq.idle_queue); + }/* Vertical blank interrupts */ if (status &RADEON_CRTC_VBLANK_STAT ) {drm_handle_vblank (rdev->ddev,0 );
drivers/gpu/drm/radeon/r600.c +10 -0
@@ -2495,6 +2495,7 @@ int r600_irq_set(struct radeon_device *rdev)u32 cp_int_cntl =CNTX_BUSY_INT_ENABLE |CNTX_EMPTY_INT_ENABLE ;u32 mode_int =0 ;u32 hpd1, hpd2, hpd3, hpd4 =0 , hpd5 =0 , hpd6 =0 ; +u32 grbm_int_cntl =0 ;if (!rdev->irq.installed) {WARN (1 ,"Can't enable IRQ/MSI because no handler is installed.\n" );
@@ -2559,9 +2560,14 @@ int r600_irq_set(struct radeon_device *rdev)DRM_DEBUG ("r600_irq_set: hpd 6\n" ); hpd6 |= DC_HPDx_INT_EN; } +if (rdev->irq.gui_idle) { +DRM_DEBUG ("gui idle\n" ); + grbm_int_cntl |=GUI_IDLE_INT_ENABLE ; + }WREG32 (CP_INT_CNTL , cp_int_cntl);WREG32 (DxMODE_INT_MASK, mode_int); +WREG32 (GRBM_INT_CNTL , grbm_int_cntl);if (ASIC_IS_DCE3 (rdev)) {WREG32 (DC_HPD1_INT_CONTROL , hpd1);WREG32 (DC_HPD2_INT_CONTROL , hpd2);
@@ -2856,6 +2862,10 @@ restart_ih:case 181 :/* CP EOP event */ DRM_DEBUG ("IH: CP EOP\n" );break ; +case 233 :/* GUI IDLE */ +DRM_DEBUG ("IH: CP EOP\n" ); +wake_up (&rdev->irq.idle_queue); +break ;default :DRM_DEBUG ("Unhandled interrupt: %d %d\n" , src_id, src_data);break ;
drivers/gpu/drm/radeon/radeon.h +2 -0
@@ -374,6 +374,8 @@ struct radeon_irq {wait_queue_head_t vblank_queue;/* FIXME: use defines for max hpd/dacs */ bool hpd[6 ]; +bool gui_idle; +wait_queue_head_t idle_queue;spinlock_t sw_lock;int sw_refcount; };
drivers/gpu/drm/radeon/radeon_device.c +1 -0
@@ -520,6 +520,7 @@ int radeon_device_init(struct radeon_device *rdev,rwlock_init (&rdev->fence_drv.lock);INIT_LIST_HEAD (&rdev->gem.objects);init_waitqueue_head (&rdev->irq.vblank_queue); +init_waitqueue_head (&rdev->irq.idle_queue);/* setup workqueue */ rdev->wq =create_workqueue ("radeon" );
drivers/gpu/drm/radeon/radeon_irq_kms.c +1 -0
@@ -95,6 +95,7 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) }/* Disable *all* interrupts */ rdev->irq.sw_int = false; + rdev->irq.gui_idle = false;for (i =0 ; i <2 ; i++) { rdev->irq.crtc_vblank_int[i] = false; rdev->irq.hpd[i] = false;
drivers/gpu/drm/radeon/radeon_reg.h +3 -0
@@ -994,6 +994,7 @@# define RADEON_FP_DETECT_MASK (1 << 4)# define RADEON_CRTC2_VBLANK_MASK (1 << 9)# define RADEON_FP2_DETECT_MASK (1 << 10) +# define RADEON_GUI_IDLE_MASK (1 << 19)# define RADEON_SW_INT_ENABLE (1 << 25)#define RADEON_GEN_INT_STATUS 0x0044# define AVIVO_DISPLAY_INT_STATUS (1 << 0)
@@ -1005,6 +1006,8 @@# define RADEON_CRTC2_VBLANK_STAT_ACK (1 << 9)# define RADEON_FP2_DETECT_STAT (1 << 10)# define RADEON_FP2_DETECT_STAT_ACK (1 << 10) +# define RADEON_GUI_IDLE_STAT (1 << 19) +# define RADEON_GUI_IDLE_STAT_ACK (1 << 19)# define RADEON_SW_INT_FIRE (1 << 26)# define RADEON_SW_INT_TEST (1 << 25)# define RADEON_SW_INT_TEST_ACK (1 << 25)
drivers/gpu/drm/radeon/rs600.c +4 -1
@@ -404,7 +404,7 @@ int rs600_irq_set(struct radeon_device *rdev)static inline uint32_t rs600_irq_ack (struct radeon_device *rdev,u32 *r500_disp_int) {uint32_t irqs =RREG32 (R_000044_GEN_INT_STATUS ); -uint32_t irq_mask = ~C_000044_SW_INT ; +uint32_t irq_mask = (S_000044_SW_INT (1 ) |S_000044_GUI_IDLE_STAT (1 ));u32 tmp;if (G_000044_DISPLAY_INT_STAT (irqs)) {
@@ -462,6 +462,9 @@ int rs600_irq_process(struct radeon_device *rdev)/* SW interrupt */ if (G_000044_SW_INT (status))radeon_fence_process (rdev); +/* GUI idle */ +if (G_000040_GUI_IDLE (status)) +wake_up (&rdev->irq.idle_queue);/* Vertical blank interrupts */ if (G_007EDC_LB_D1_VBLANK_INTERRUPT (r500_disp_int)) {drm_handle_vblank (rdev->ddev,0 );
Signature · 1 line
1.5.6.3
From 93a35bf97ec0ba26a55944fdd6d53ad98c46aaaa Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 02:49:10 -0400
Subject: [PATCH] drm/radeon/kms: wait for gpu idle before changing power mode
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
set proper wait condition as noted by Rafał Miłecki.
--- drivers/gpu/drm/radeon/r100.c | 1 + drivers/gpu/drm/radeon/r600.c | 1 + drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_pm.c | 11 +++++++++++ drivers/gpu/drm/radeon/rs600.c | 4 +++- 5 files changed, 17 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/r100.c +1 -0
@@ -320,6 +320,7 @@ int r100_irq_process(struct radeon_device *rdev) }/* gui idle interrupt */ if (status &RADEON_GUI_IDLE_STAT ) { + rdev->pm.gui_idle = true;wake_up (&rdev->irq.idle_queue); }/* Vertical blank interrupts */
drivers/gpu/drm/radeon/r600.c +1 -0
@@ -2864,6 +2864,7 @@ restart_ih:break ;case 233 :/* GUI IDLE */ DRM_DEBUG ("IH: CP EOP\n" ); + rdev->pm.gui_idle = true;wake_up (&rdev->irq.idle_queue);break ;default :
drivers/gpu/drm/radeon/radeon.h +1 -0
@@ -692,6 +692,7 @@ struct radeon_pm {int active_crtcs;int req_vblank;bool vblank_sync; +bool gui_idle;fixed20_12 max_bandwidth;fixed20_12 igp_sideport_mclk;fixed20_12 igp_system_mclk;
drivers/gpu/drm/radeon/radeon_pm.c +11 -0
@@ -27,6 +27,7 @@#define RADEON_IDLE_LOOP_MS 100#define RADEON_RECLOCK_DELAY_MS 200#define RADEON_WAIT_VBLANK_TIMEOUT 200 +#define RADEON_WAIT_IDLE_TIMEOUT 200static bool radeon_pm_debug_check_in_vbl (struct radeon_device *rdev,bool finish);static void radeon_pm_set_clocks_locked (struct radeon_device *rdev);
@@ -377,6 +378,16 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)radeon_get_power_state (rdev, rdev->pm.planned_action);mutex_lock (&rdev->cp.mutex); +/* wait for GPU idle */ + rdev->pm.gui_idle = false; + rdev->irq.gui_idle = true; +radeon_irq_set (rdev); +wait_event_interruptible_timeout ( + rdev->irq.idle_queue, rdev->pm.gui_idle, +msecs_to_jiffies (RADEON_WAIT_IDLE_TIMEOUT )); + rdev->irq.gui_idle = false; +radeon_irq_set (rdev); +if (rdev->pm.active_crtcs & (1 <<0 )) { rdev->pm.req_vblank |= (1 <<0 );drm_vblank_get (rdev->ddev,0 );
drivers/gpu/drm/radeon/rs600.c +3 -1
@@ -463,8 +463,10 @@ int rs600_irq_process(struct radeon_device *rdev)if (G_000044_SW_INT (status))radeon_fence_process (rdev);/* GUI idle */ -if (G_000040_GUI_IDLE (status)) +if (G_000040_GUI_IDLE (status)) { + rdev->pm.gui_idle = true;wake_up (&rdev->irq.idle_queue); + }/* Vertical blank interrupts */ if (G_007EDC_LB_D1_VBLANK_INTERRUPT (r500_disp_int)) {drm_handle_vblank (rdev->ddev,0 );
Signature · 1 line
1.5.6.3
From dc873b778227daaba8b107e60ce7b100863f8029 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Sun, 14 Mar 2010 14:08:32 -0400
Subject: [PATCH] drm/radeon/kms/pm: rework power mode parsing
On pre-r6xx, the power mode array is ordered:
low
...
high
default
On r6xx+:
default
low
...
high
--- drivers/gpu/drm/radeon/radeon_atombios.c | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +19 -4
@@ -1525,6 +1525,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) num_modes = power_info->info.ucNumOfPowerModeEntries;if (num_modes >ATOM_MAX_NUMBEROF_POWER_BLOCK ) num_modes =ATOM_MAX_NUMBEROF_POWER_BLOCK ; +/* last mode is always default, array is low to high */ for (i =0 ; i < num_modes; i++) { rdev->pm.power_state[state_index].clock_info[0 ].voltage.type =VOLTAGE_NONE ;switch (frev) {
@@ -1730,6 +1731,14 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)break ; } } +/* last mode is always default */ +if (!rdev->pm.default_power_state) { + rdev->pm.power_state[state_index -1 ].type = +POWER_STATE_TYPE_DEFAULT ; + rdev->pm.default_power_state = &rdev->pm.power_state[state_index -1 ]; + rdev->pm.power_state[state_index -1 ].default_clock_mode = + &rdev->pm.power_state[state_index -1 ].clock_info[0 ]; + } }else if (frev ==4 ) {/* add the i2c bus for thermal/fan chip */ /* no support for internal controller yet */
@@ -1749,6 +1758,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) rdev->pm.i2c_bus =radeon_i2c_create (rdev->ddev, &i2c_bus,"Thermal" ); } } +/* first mode is always default, followed by low to high */ for (i =0 ; i < power_info->info_4.ucNumStates; i++) { mode_index =0 ; power_state = (struct _ATOM_PPLIB_STATE *)
@@ -1848,12 +1858,16 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) state_index++; } } +/* first mode is always default */ +if (!rdev->pm.default_power_state) { + rdev->pm.power_state[0 ].type = +POWER_STATE_TYPE_DEFAULT ; + rdev->pm.default_power_state = &rdev->pm.power_state[0 ]; + rdev->pm.power_state[0 ].default_clock_mode = + &rdev->pm.power_state[0 ].clock_info[0 ]; + } } }else { -/* XXX figure out some good default low power mode for cards w/out power tables */ - } - -if (rdev->pm.default_power_state ==NULL ) {/* add the default mode */ rdev->pm.power_state[state_index].type =POWER_STATE_TYPE_DEFAULT ;
@@ -1870,6 +1884,7 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; state_index++; } + rdev->pm.num_power_states = state_index; rdev->pm.current_power_state = rdev->pm.default_power_state;
Signature · 1 line
1.5.6.3
From 76314be2d6eb1755ec7a4ec617ecfb2016a834cc Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 01:56:04 -0400
Subject: [PATCH] drm/radeon/kms/pm: add asic specific callbacks for setting power state
--- drivers/gpu/drm/radeon/r100.c | 37 +++++++++++++++++++++++ drivers/gpu/drm/radeon/r600.c | 37 +++++++++++++++++++++++ drivers/gpu/drm/radeon/radeon.h | 4 ++ drivers/gpu/drm/radeon/radeon_asic.c | 13 ++++++++ drivers/gpu/drm/radeon/radeon_asic.h | 3 ++ drivers/gpu/drm/radeon/radeon_pm.c | 53 ++++++++------------------------- drivers/gpu/drm/radeon/radeon_reg.h | 1 - 7 files changed, 107 insertions(+), 41 deletions(-)
drivers/gpu/drm/radeon/r100.c +37 -0
@@ -66,6 +66,43 @@ MODULE_FIRMWARE(FIRMWARE_R520);* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ +void r100_set_power_state (struct radeon_device *rdev) +{ +/* if *_clock_mode are the same, *_power_state are as well */ +if (rdev->pm.requested_clock_mode == rdev->pm.current_clock_mode) +return ; + +DRM_INFO ("Setting: e: %d m: %d p: %d\n" , + rdev->pm.requested_clock_mode->sclk, + rdev->pm.requested_clock_mode->mclk, + rdev->pm.requested_power_state->non_clock_info.pcie_lanes); + +/* set pcie lanes */ +/* TODO */ + +/* set voltage */ +/* TODO */ + +/* set engine clock */ +radeon_sync_with_vblank (rdev); +radeon_pm_debug_check_in_vbl (rdev, false); +radeon_set_engine_clock (rdev, rdev->pm.requested_clock_mode->sclk); +radeon_pm_debug_check_in_vbl (rdev, true); + +#if 0 +/* set memory clock */ +if (rdev->asic->set_memory_clock) { +radeon_sync_with_vblank (rdev); +radeon_pm_debug_check_in_vbl (rdev, false); +radeon_set_memory_clock (rdev, rdev->pm.requested_clock_mode->mclk); +radeon_pm_debug_check_in_vbl (rdev, true); + } +#endif + + rdev->pm.current_power_state = rdev->pm.requested_power_state; + rdev->pm.current_clock_mode = rdev->pm.requested_clock_mode; +} +bool r100_gui_idle (struct radeon_device *rdev) {if (RREG32 (RADEON_RBBM_STATUS ) &RADEON_RBBM_ACTIVE )
drivers/gpu/drm/radeon/r600.c +37 -0
@@ -75,6 +75,43 @@ int r600_mc_wait_for_idle(struct radeon_device *rdev);void r600_gpu_init (struct radeon_device *rdev);void r600_fini (struct radeon_device *rdev); +void r600_set_power_state (struct radeon_device *rdev) +{ +/* if *_clock_mode are the same, *_power_state are as well */ +if (rdev->pm.requested_clock_mode == rdev->pm.current_clock_mode) +return ; + +DRM_INFO ("Setting: e: %d m: %d p: %d\n" , + rdev->pm.requested_clock_mode->sclk, + rdev->pm.requested_clock_mode->mclk, + rdev->pm.requested_power_state->non_clock_info.pcie_lanes); + +/* set pcie lanes */ +/* TODO */ + +/* set voltage */ +/* TODO */ + +/* set engine clock */ +radeon_sync_with_vblank (rdev); +radeon_pm_debug_check_in_vbl (rdev, false); +radeon_set_engine_clock (rdev, rdev->pm.requested_clock_mode->sclk); +radeon_pm_debug_check_in_vbl (rdev, true); + +#if 0 +/* set memory clock */ +if (rdev->asic->set_memory_clock) { +radeon_sync_with_vblank (rdev); +radeon_pm_debug_check_in_vbl (rdev, false); +radeon_set_memory_clock (rdev, rdev->pm.requested_clock_mode->mclk); +radeon_pm_debug_check_in_vbl (rdev, true); + } +#endif + + rdev->pm.current_power_state = rdev->pm.requested_power_state; + rdev->pm.current_clock_mode = rdev->pm.requested_clock_mode; +} +bool r600_gui_idle (struct radeon_device *rdev) {if (RREG32 (GRBM_STATUS ) &GUI_ACTIVE )
drivers/gpu/drm/radeon/radeon.h +4 -0
@@ -173,6 +173,8 @@ void radeon_pm_fini(struct radeon_device *rdev);void radeon_pm_compute_clocks (struct radeon_device *rdev);void radeon_combios_get_power_modes (struct radeon_device *rdev);void radeon_atombios_get_power_modes (struct radeon_device *rdev); +bool radeon_pm_debug_check_in_vbl (struct radeon_device *rdev,bool finish); +void radeon_sync_with_vblank (struct radeon_device *rdev);/* * Fences.
@@ -802,6 +804,7 @@ struct radeon_asic {*/ void (*ioctl_wait_idle)(struct radeon_device *rdev,struct radeon_bo *bo);bool (*gui_idle)(struct radeon_device *rdev); +void (*set_power_state)(struct radeon_device *rdev); };/*
@@ -1187,6 +1190,7 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)#define radeon_hpd_sense (rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))#define radeon_hpd_set_polarity (rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd))#define radeon_gui_idle (rdev) (rdev)->asic->gui_idle((rdev)) +#define radeon_set_power_state (rdev) (rdev)->asic->set_power_state((rdev))/* Common functions */ /* AGP */
drivers/gpu/drm/radeon/radeon_asic.c +13 -0
@@ -166,6 +166,7 @@ static struct radeon_asic r100_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic r200_asic = {
@@ -205,6 +206,7 @@ static struct radeon_asic r200_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic r300_asic = {
@@ -245,6 +247,7 @@ static struct radeon_asic r300_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic r300_asic_pcie = {
@@ -284,6 +287,7 @@ static struct radeon_asic r300_asic_pcie = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic r420_asic = {
@@ -324,6 +328,7 @@ static struct radeon_asic r420_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic rs400_asic = {
@@ -364,6 +369,7 @@ static struct radeon_asic rs400_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic rs600_asic = {
@@ -404,6 +410,7 @@ static struct radeon_asic rs600_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic rs690_asic = {
@@ -444,6 +451,7 @@ static struct radeon_asic rs690_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic rv515_asic = {
@@ -484,6 +492,7 @@ static struct radeon_asic rv515_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic r520_asic = {
@@ -524,6 +533,7 @@ static struct radeon_asic r520_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .set_power_state = &r100_set_power_state, };static struct radeon_asic r600_asic = {
@@ -563,6 +573,7 @@ static struct radeon_asic r600_asic = { .hpd_set_polarity = &r600_hpd_set_polarity, .ioctl_wait_idle = r600_ioctl_wait_idle, .gui_idle = &r600_gui_idle, + .set_power_state = &r600_set_power_state, };static struct radeon_asic rv770_asic = {
@@ -602,6 +613,7 @@ static struct radeon_asic rv770_asic = { .hpd_set_polarity = &r600_hpd_set_polarity, .ioctl_wait_idle = r600_ioctl_wait_idle, .gui_idle = &r600_gui_idle, + .set_power_state = &r600_set_power_state, };static struct radeon_asic evergreen_asic = {
@@ -639,6 +651,7 @@ static struct radeon_asic evergreen_asic = { .hpd_sense = &evergreen_hpd_sense, .hpd_set_polarity = &evergreen_hpd_set_polarity, .gui_idle = &r600_gui_idle, + .set_power_state = &r600_set_power_state, };int radeon_asic_init (struct radeon_device *rdev)
drivers/gpu/drm/radeon/radeon_asic.h +3 -0
@@ -127,6 +127,8 @@ void r100_enable_bm(struct radeon_device *rdev);void r100_set_common_regs (struct radeon_device *rdev);void r100_bm_disable (struct radeon_device *rdev);extern bool r100_gui_idle (struct radeon_device *rdev); +extern void r100_set_power_state (struct radeon_device *rdev); +/* * r200,rv250,rs300,rv280 */
@@ -271,6 +273,7 @@ void r600_hpd_set_polarity(struct radeon_device *rdev, enum radeon_hpd_id hpd);extern void r600_ioctl_wait_idle (struct radeon_device *rdev,struct radeon_bo *bo);extern bool r600_gui_idle (struct radeon_device *rdev); +extern void r600_set_power_state (struct radeon_device *rdev);/* * rv770,rv730,rv710,rv740
drivers/gpu/drm/radeon/radeon_pm.c +13 -40
83 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon_reg.h +0 -1
@@ -552,7 +552,6 @@# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16)#define RADEON_CRTC2_CRNT_FRAME 0x0314#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318 -#define RADEON_CRTC2_STATUS 0x03fc#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310#define RADEON_CRTC8_DATA 0x03d5/* VGA, 0x3b5 */ #define RADEON_CRTC8_IDX 0x03d4/* VGA, 0x3b4 */
Signature · 1 line
1.5.6.3
From f1a5f806086ae38bf2662d26199527fc0ada7ff0 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 02:28:03 -0400
Subject: [PATCH] drm/radeon/kms/pm: add asic specific callbacks for getting power state
For pre-r6xx cards, there is only one clock mode per power state so there is no need to pick one.
On r6xx+, just select the first non-default power state and select between the clock modes. Eventually, we will want to select a power state based on external factors (AC/DC state, user selection, etc.).
--- drivers/gpu/drm/radeon/r100.c | 78 +++++++++++++++++-- drivers/gpu/drm/radeon/r600.c | 111 ++++++++++++++++++++++++-- drivers/gpu/drm/radeon/radeon.h | 15 ++-- drivers/gpu/drm/radeon/radeon_asic.c | 13 +++ drivers/gpu/drm/radeon/radeon_asic.h | 4 + drivers/gpu/drm/radeon/radeon_atombios.c | 53 +++---------- drivers/gpu/drm/radeon/radeon_combios.c | 9 +- drivers/gpu/drm/radeon/radeon_pm.c | 124 ++---------------------------- 8 files changed, 219 insertions(+), 188 deletions(-)
drivers/gpu/drm/radeon/r100.c +69 -9
105 lines not on this page · raw message
drivers/gpu/drm/radeon/r600.c +102 -9
138 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon.h +9 -6
@@ -690,7 +690,8 @@ struct radeon_pm {enum radeon_pm_state state;enum radeon_pm_action planned_action;unsigned long action_timeout; -bool downclocked; +bool can_upclock; +bool can_downclock;int active_crtcs;int req_vblank;bool vblank_sync;
@@ -710,11 +711,11 @@ struct radeon_pm {struct radeon_power_state power_state[8 ];/* number of valid power states */ int num_power_states; -struct radeon_power_state *current_power_state; -struct radeon_pm_clock_info *current_clock_mode; -struct radeon_power_state *requested_power_state; -struct radeon_pm_clock_info *requested_clock_mode; -struct radeon_power_state *default_power_state; +int current_power_state_index; +int current_clock_mode_index; +int requested_power_state_index; +int requested_clock_mode_index; +int default_power_state_index;struct radeon_i2c_chan *i2c_bus; };
@@ -804,6 +805,7 @@ struct radeon_asic {*/ void (*ioctl_wait_idle)(struct radeon_device *rdev,struct radeon_bo *bo);bool (*gui_idle)(struct radeon_device *rdev); +void (*get_power_state)(struct radeon_device *rdev,enum radeon_pm_action action);void (*set_power_state)(struct radeon_device *rdev); };
@@ -1190,6 +1192,7 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)#define radeon_hpd_sense (rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))#define radeon_hpd_set_polarity (rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd))#define radeon_gui_idle (rdev) (rdev)->asic->gui_idle((rdev)) +#define radeon_get_power_state (rdev, a) (rdev)->asic->get_power_state((rdev), (a))#define radeon_set_power_state (rdev) (rdev)->asic->set_power_state((rdev))/* Common functions */
drivers/gpu/drm/radeon/radeon_asic.c +13 -0
@@ -166,6 +166,7 @@ static struct radeon_asic r100_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -206,6 +207,7 @@ static struct radeon_asic r200_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -247,6 +249,7 @@ static struct radeon_asic r300_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -287,6 +290,7 @@ static struct radeon_asic r300_asic_pcie = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -328,6 +332,7 @@ static struct radeon_asic r420_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -369,6 +374,7 @@ static struct radeon_asic rs400_asic = { .hpd_set_polarity = &r100_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -410,6 +416,7 @@ static struct radeon_asic rs600_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -451,6 +458,7 @@ static struct radeon_asic rs690_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -492,6 +500,7 @@ static struct radeon_asic rv515_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -533,6 +542,7 @@ static struct radeon_asic r520_asic = { .hpd_set_polarity = &rs600_hpd_set_polarity, .ioctl_wait_idle = NULL, .gui_idle = &r100_gui_idle, + .get_power_state = &r100_get_power_state, .set_power_state = &r100_set_power_state, };
@@ -573,6 +583,7 @@ static struct radeon_asic r600_asic = { .hpd_set_polarity = &r600_hpd_set_polarity, .ioctl_wait_idle = r600_ioctl_wait_idle, .gui_idle = &r600_gui_idle, + .get_power_state = &r600_get_power_state, .set_power_state = &r600_set_power_state, };
@@ -613,6 +624,7 @@ static struct radeon_asic rv770_asic = { .hpd_set_polarity = &r600_hpd_set_polarity, .ioctl_wait_idle = r600_ioctl_wait_idle, .gui_idle = &r600_gui_idle, + .get_power_state = &r600_get_power_state, .set_power_state = &r600_set_power_state, };
@@ -651,6 +663,7 @@ static struct radeon_asic evergreen_asic = { .hpd_sense = &evergreen_hpd_sense, .hpd_set_polarity = &evergreen_hpd_set_polarity, .gui_idle = &r600_gui_idle, + .get_power_state = &r600_get_power_state, .set_power_state = &r600_set_power_state, };
drivers/gpu/drm/radeon/radeon_asic.h +4 -0
@@ -128,6 +128,8 @@ void r100_set_common_regs(struct radeon_device *rdev);void r100_bm_disable (struct radeon_device *rdev);extern bool r100_gui_idle (struct radeon_device *rdev);extern void r100_set_power_state (struct radeon_device *rdev); +extern void r100_get_power_state (struct radeon_device *rdev, +enum radeon_pm_action action);/* * r200,rv250,rs300,rv280
@@ -274,6 +276,8 @@ void r600_hpd_set_polarity(struct radeon_device *rdev,extern void r600_ioctl_wait_idle (struct radeon_device *rdev,struct radeon_bo *bo);extern bool r600_gui_idle (struct radeon_device *rdev);extern void r600_set_power_state (struct radeon_device *rdev); +extern void r600_get_power_state (struct radeon_device *rdev, +enum radeon_pm_action action);/* * rv770,rv730,rv710,rv740
drivers/gpu/drm/radeon/radeon_atombios.c +12 -41
140 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon_combios.c +4 -5
@@ -2356,7 +2356,7 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev)u8 rev, blocks, tmp;int state_index =0 ; - rdev->pm.default_power_state =NULL ; + rdev->pm.default_power_state_index =-1 ;if (rdev->flags &RADEON_IS_MOBILITY ) { offset =combios_get_table_offset (dev,COMBIOS_POWERPLAY_INFO_TABLE );
@@ -2450,12 +2450,11 @@ default_mode: rdev->pm.power_state[state_index].non_clock_info.pcie_lanes =radeon_get_pcie_lanes (rdev); else rdev->pm.power_state[state_index].non_clock_info.pcie_lanes = 16; - rdev->pm.default_power_state = &rdev->pm.power_state[state_index]; + rdev->pm.default_power_state_index = state_index; rdev->pm.num_power_states = state_index +1 ; - rdev->pm.current_power_state = rdev->pm.default_power_state; - rdev->pm.current_clock_mode = - rdev->pm.default_power_state->default_clock_mode; + rdev->pm.current_power_state_index = rdev->pm.default_power_state_index; + rdev->pm.current_clock_mode_index =0 ; }void radeon_external_tmds_setup (struct drm_encoder *encoder)
drivers/gpu/drm/radeon/radeon_pm.c +6 -118
166 lines not on this page · raw message
Signature · 1 line
1.5.6.3
From b08f859df04ce5eacc5f87b809d14961e8101f40 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 15 Mar 2010 03:18:30 -0400
Subject: [PATCH] drm/radeon/kms/r6xx+: add support for SIMD pm
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
SIMD (Single Instruction Multiple Data) blocks are the computational blocks of the shader engine.
Turn off some SIMDs when in lower power states.
Actually write the new SIMD config to the hardware as noted by Rafał Miłecki.
Leave disabled for now.
--- drivers/gpu/drm/radeon/r600.c | 27 ++++++++++++++++++++++++++- drivers/gpu/drm/radeon/radeon.h | 5 +++++ drivers/gpu/drm/radeon/rv770.c | 12 ++++++++++++ 3 files changed, 43 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/r600.c +26 -1
@@ -90,11 +90,13 @@ void r600_get_power_state(struct radeon_device *rdev,switch (action) {case PM_ACTION_MINIMUM :case PM_ACTION_DOWNCLOCK : + rdev->pm.requested_simd_mask = rdev->pm.low_simd_mask; rdev->pm.requested_power_state_index =0 ; rdev->pm.requested_clock_mode_index =0 ; rdev->pm.can_downclock = false;break ;case PM_ACTION_UPCLOCK : + rdev->pm.requested_simd_mask = rdev->pm.normal_simd_mask; rdev->pm.requested_power_state_index =1 ; rdev->pm.requested_clock_mode_index =0 ; rdev->pm.can_upclock = false;
@@ -112,10 +114,12 @@ void r600_get_power_state(struct radeon_device *rdev,switch (action) {case PM_ACTION_MINIMUM : + rdev->pm.requested_simd_mask = rdev->pm.low_simd_mask; rdev->pm.requested_clock_mode_index =0 ; rdev->pm.can_downclock = false;break ;case PM_ACTION_DOWNCLOCK : + rdev->pm.requested_simd_mask = rdev->pm.low_simd_mask;if (rdev->pm.current_clock_mode_index ==0 ) { rdev->pm.requested_clock_mode_index =0 ; rdev->pm.can_downclock = false;
@@ -124,6 +128,7 @@ void r600_get_power_state(struct radeon_device *rdev, rdev->pm.current_clock_mode_index -1 ;break ;case PM_ACTION_UPCLOCK : + rdev->pm.requested_simd_mask = rdev->pm.normal_simd_mask;if (rdev->pm.current_clock_mode_index == (rdev->pm.power_state[rdev->pm.requested_power_state_index].num_clock_modes -1 )) { rdev->pm.requested_clock_mode_index = rdev->pm.current_clock_mode_index;
@@ -200,7 +205,16 @@ void r600_set_power_state(struct radeon_device *rdev) radeon_pm_debug_check_in_vbl(rdev, true); }#endif - +#if 0 +if (radeon_gui_idle (rdev) && + (rdev->pm.current_simd_mask != rdev->pm.requested_simd_mask)) { +u32 tmp =RREG32 (GC_USER_SHADER_PIPE_CONFIG ) & ~INACTIVE_SIMDS_MASK ; + tmp |=INACTIVE_SIMDS (rdev->pm.requested_simd_mask) &INACTIVE_SIMDS_MASK ; + rdev->pm.current_simd_mask = rdev->pm.requested_simd_mask; +WREG32 (GC_USER_SHADER_PIPE_CONFIG , tmp); +DRM_INFO ("changed simds\n" ); + } +#endif rdev->pm.current_power_state_index = rdev->pm.requested_power_state_index; rdev->pm.current_clock_mode_index = rdev->pm.requested_clock_mode_index; }
@@ -1114,6 +1128,7 @@ void r600_gpu_init(struct radeon_device *rdev)u32 sq_thread_resource_mgmt =0 ;u32 sq_stack_resource_mgmt_1 =0 ;u32 sq_stack_resource_mgmt_2 =0 ; +u32 simd_mask, num_simds;/* FIXME: implement */ switch (rdev->family) {
@@ -1255,6 +1270,16 @@ void r600_gpu_init(struct radeon_device *rdev)WREG32 (CC_RB_BACKEND_DISABLE , cc_rb_backend_disable);WREG32 (CC_GC_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config);WREG32 (GC_USER_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config); +/* pm */ + simd_mask = (cc_gc_shader_pipe_config &INACTIVE_SIMDS_MASK ) >>16 ; + rdev->pm.normal_simd_mask = simd_mask; + rdev->pm.current_simd_mask = simd_mask; + num_simds =r600_count_pipe_bits ((~simd_mask) &0xff ); +for (i =0 ; i < (num_simds -1 ); i++) { +if ((simd_mask & (1 << i)) ==0 ) + simd_mask |= (1 << i); + } + rdev->pm.low_simd_mask = simd_mask; tmp =R6XX_MAX_PIPES -r600_count_pipe_bits ((cc_gc_shader_pipe_config &INACTIVE_QD_PIPES_MASK ) >>8 );WREG32 (VGT_OUT_DEALLOC_CNTL , (tmp *4 ) &DEALLOC_DIST_MASK );
drivers/gpu/drm/radeon/radeon.h +5 -0
@@ -717,6 +717,11 @@ struct radeon_pm {int requested_clock_mode_index;int default_power_state_index;struct radeon_i2c_chan *i2c_bus; +/* r6xx+ only */ +u32 low_simd_mask; +u32 normal_simd_mask; +u32 current_simd_mask; +u32 requested_simd_mask; };
drivers/gpu/drm/radeon/rv770.c +12 -0
@@ -470,6 +470,7 @@ static void rv770_gpu_init(struct radeon_device *rdev)u32 cc_gc_shader_pipe_config =0 ;u32 mc_arb_ramcfg;u32 db_debug4; +u32 simd_mask, num_simds;/* setup chip specs */ switch (rdev->family) {
@@ -651,6 +652,17 @@ static void rv770_gpu_init(struct radeon_device *rdev)WREG32 (GC_USER_SHADER_PIPE_CONFIG , cc_gc_shader_pipe_config);WREG32 (CC_SYS_RB_BACKEND_DISABLE , cc_rb_backend_disable); +/* pm */ + simd_mask = (cc_gc_shader_pipe_config &INACTIVE_SIMDS_MASK ) >>16 ; + rdev->pm.normal_simd_mask = simd_mask; + rdev->pm.current_simd_mask = simd_mask; + num_simds =r600_count_pipe_bits ((~simd_mask) &0xff ); +for (i =0 ; i < (num_simds -1 ); i++) { +if ((simd_mask & (1 << i)) ==0 ) + simd_mask |= (1 << i); + } + rdev->pm.low_simd_mask = simd_mask; +WREG32 (CGTS_SYS_TCC_DISABLE ,0 );WREG32 (CGTS_TCC_DISABLE ,0 );WREG32 (CGTS_USER_SYS_TCC_DISABLE ,0 );
Signature · 1 line
1.5.6.3
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 11 lines · Alex Deucher
Quoted 6 lines · Alex Deucher
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/Updated patches rebased against airlied's new drm-radeon-testing along with the fixes noted in Rafal's comments:
http://people.freedesktop.org/~agd5f/pm2/
Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/
These implement much the remaining pm functionality. So far they are working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exit
Alex
Quoted 32 lines
Alex
Quoted 27 lines
So far I haven't seen any corruption when changing power modes.
What the patches do:
- implement gui idle irq support
- only change clocks when the engine is idle
- add support for turning down the number of active simds in lower power modes (r6xx+)
- add apm_finifunction
- move set/get power state logic into asic specific callbacks. Different strategies for handling
different power tables formats.Things left to do:
- reset clocks to default on module unload (inpm_finifunction)
- add request module support for hwmon i2c thermal chip drivers
- add hwmon support for internal thermal/fan support used on some r6xx/r7xx boards
- add more robust power state selection
- tie power state selection into external events (manual power mode selection, AC/DC state, etc.)
- hook up memory reclocking
- hook up pcie lane setting
- hook up voltage settingAlex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
2010/3/17 Alex Deucher <[email protected]>:
Quoted 16 lines · Alex Deucher
Quoted 11 lines · Alex Deucher
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/Updated patches rebased against airlied's new drm-radeon-testing along with the fixes noted in Rafal's comments:
http://people.freedesktop.org/~agd5f/pm2/Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/
Quoted 8 lines
These implement much the remaining pm functionality. So far they are working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exit
Nice, looks alright, thanks. Will test later if I manage before leaving for skiing.
Do you know if we could ever recolck memory on multiple CRTCs? If not, what's the reason?
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/17 Rafał Miłecki <[email protected]>:
Quoted 26 lines
2010/3/17 Alex Deucher <[email protected]>:
Quoted 16 lines · Alex Deucher
Quoted 11 lines · Alex Deucher
Quoted 6 lines
This weekend I finally got some time to sit down with kms pm, and I created a new patch set (against drm-radeon-testing). For those that want to play with the i2c stuff for thermal chips, you'll probably grab my recent i2c patches as well. You can grab my latest pm patches here:
http://people.freedesktop.org/~agd5f/pm2/Updated patches rebased against airlied's new drm-radeon-testing along with the fixes noted in Rafal's comments:
http://people.freedesktop.org/~agd5f/pm2/Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/Quoted 8 lines
These implement much the remaining pm functionality. So far they are working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exit
Quoted 2 lines
Nice, looks alright, thanks. Will test later if I manage before leaving for skiing.
Thanks.
Quoted 3 lines
Do you know if we could ever recolck memory on multiple CRTCs? If not, what's the reason?
I think so. It works now more or less, there's just an occasional jitter on the head not synced. I'm trying to find out how we do it internally.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/17 Alex Deucher <[email protected]>:
Quoted 2 lines
Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/
Not serious thing, but still it's warning...
# git am pm2/0001*
Applying: drm/radeon/kms/atom: make sure tables are valid
/home/drm-2.6/.git/rebase-apply/patch:475: space before tab in indent.
if (atom_parse_data_header(mode_info->atom_context, index,
NULL, &frev, &crev, &data_offset)) {
/home/drm-2.6/.git/rebase-apply/patch:476: space before tab in indent.
power_info = (union power_info
*)(mode_info->atom_context->bios + data_offset);
warning: 2 lines add whitespace errors.Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/17 Rafał Miłecki <[email protected]>:
Quoted 6 lines
2010/3/17 Alex Deucher <[email protected]>:
Quoted 2 lines
Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/Not serious thing, but still it's warning...
Quoted 9 lines
# git am pm2/0001*
Applying: drm/radeon/kms/atom: make sure tables are valid
/home/drm-2.6/.git/rebase-apply/patch:475: space before tab in indent.
if (atom_parse_data_header(mode_info->atom_context, index,
NULL, &frev, &crev, &data_offset)) {
/home/drm-2.6/.git/rebase-apply/patch:476: space before tab in indent.
power_info = (union power_info
*)(mode_info->atom_context->bios + data_offset);
warning: 2 lines add whitespace errors.Looks like I was a little too quirk with that patch :) I'll get that fixed up.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/17 Alex Deucher <[email protected]>
Quoted 11 lines
Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/These implement much the remaining pm functionality. So far they are working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exit
It seems memory reclocking and SIMDs setting is disabled for r6xx with currently available patches...?
Otherwise it seems to work fine.
--
Rafał
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/17 Rafał Miłecki <[email protected]>:
Quoted 13 lines
2010/3/17 Alex Deucher <[email protected]>
Quoted 11 lines
Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/These implement much the remaining pm functionality. So far they are working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exit
Quoted 3 lines
It seems memory reclocking and SIMDs setting is disabled for r6xx with currently available patches...?
It re-clocks memory (for single head anyway), r600_set_power_state():
/* set memory clock */
if (rdev->asic->set_memory_clock && (mclk !=
rdev->pm.current_mclk)) {
radeon_sync_with_vblank(rdev);
radeon_pm_debug_check_in_vbl(rdev, false);
radeon_set_memory_clock(rdev, mclk);
radeon_pm_debug_check_in_vbl(rdev, true);
rdev->pm.current_mclk = mclk;
DRM_INFO("Setting: m: %d\n", mclk);
}The simd stuff is still disabled at the moment.
Quoted 1 line
Otherwise it seems to work fine.
Thanks for testing.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
W dniu 18 marca 2010 04:27 użytkownik Alex Deucher
Quoted 31 lines · <[email protected]> napisał:
2010/3/17 Rafał Miłecki <[email protected]>:
Quoted 13 lines
2010/3/17 Alex Deucher <[email protected]>
Quoted 11 lines
Another set of updated patches against drm-radeon-testing:
http://people.freedesktop.org/~agd5f/pm2/These implement much the remaining pm functionality. So far they are working well here.
these patches add:
- memory reclocking
- pcie lane changes
- update display watermarks as bandwidth changes
- allow power management with multi-head
- reset power mode on exitQuoted 3 lines
It seems memory reclocking and SIMDs setting is disabled for r6xx with currently available patches...?
It re-clocks memory (for single head anyway),
r600_set_power_state():/* set memory clock */
if (rdev->asic->set_memory_clock&& (mclk !=rdev->pm.current_mclk)) {radeon_sync_with_vblank(rdev);radeon_pm_debug_check_in_vbl(rdev, false);radeon_set_memory_clock(rdev, mclk);radeon_pm_debug_check_in_vbl(rdev, true);rdev->pm.current_mclk= mclk;DRM_INFO("Setting: m: %d\n", mclk); }
Quoted 1 line
The simd stuff is still disabled at the moment.
Whoops, I missed one patch. My mistake.
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 1 line · W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki <[email protected]> napisał:
Whoops, I missed one patch. My mistake.
I've just applied all patches dated as "17-Mar-2010 22:42" and tested.
Now memory reclocking is really enabled, but it causes corruptions for me. Maybe that's the same thing you experienced with dual head?
Video is *far* from perfect, but maybe will give you some idea of what do I experience:
http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4
The same happened for me before all your patches, when I tried to enable memory reclocking on my own.
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/18 Rafał Miłecki <[email protected]>:
Quoted 8 lines
Quoted 1 line · W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki <[email protected]> napisał:
Whoops, I missed one patch. My mistake.
I've just applied all patches dated as "17-Mar-2010 22:42" and tested.
Now memory reclocking is really enabled, but it causes corruptions for me. Maybe that's the same thing you experienced with dual head?
Quoted 6 lines
Video is *far* from perfect, but maybe will give you some idea of what do I experience:
http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4The same happened for me before all your patches, when I tried to enable memory reclocking on my own.
yeah, the similar to what I saw with dualhead. I guess we are either missing the vblank window or the reclock is taking too much time. I wonder if it would make sense to wait for a vline rather than vblank, say a vline 1/2 or 2/3 of the way down the screen, to give us some buffer time between calling the reclock function and whatever setup it does and the beginning of the actual vblank period.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
W dniu 18 marca 2010 17:40 użytkownik Alex Deucher
Quoted 16 lines · <[email protected]> napisał:
2010/3/18 Rafał Miłecki <[email protected]>:
Quoted 8 lines
Quoted 1 line · W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki <[email protected]> napisał:
Whoops, I missed one patch. My mistake.
I've just applied all patches dated as "17-Mar-2010 22:42" and tested.
Now memory reclocking is really enabled, but it causes corruptions for me. Maybe that's the same thing you experienced with dual head?
Quoted 6 lines
Video is *far* from perfect, but maybe will give you some idea of what do I experience:
http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4The same happened for me before all your patches, when I tried to enable memory reclocking on my own.
Quoted 6 lines
yeah, the similar to what I saw with dualhead. I guess we are either missing the vblank window or the reclock is taking too much time. I wonder if it would make sense to wait for a vline rather than vblank, say a vline 1/2 or 2/3 of the way down the screen, to give us some buffer time between calling the reclock function and whatever setup it does and the beginning of the actual vblank period.
If you suspect too slow resuming reclokcing context you can try tricks from:
http://marc.info/?l=linux-kernel&m=126730151530139&w=2
It's about setting higher priority for reclocking context or switching to busy waiting.
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
W dniu 18 marca 2010 17:40 użytkownik Alex Deucher
Quoted 16 lines · <[email protected]> napisał:
2010/3/18 Rafał Miłecki <[email protected]>:
Quoted 8 lines
Quoted 1 line · W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki <[email protected]> napisał:
Whoops, I missed one patch. My mistake.
I've just applied all patches dated as "17-Mar-2010 22:42" and tested.
Now memory reclocking is really enabled, but it causes corruptions for me. Maybe that's the same thing you experienced with dual head?
Quoted 6 lines
Video is *far* from perfect, but maybe will give you some idea of what do I experience:
http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4The same happened for me before all your patches, when I tried to enable memory reclocking on my own.
Quoted 6 lines
yeah, the similar to what I saw with dualhead. I guess we are either missing the vblank window or the reclock is taking too much time. I wonder if it would make sense to wait for a vline rather than vblank, say a vline 1/2 or 2/3 of the way down the screen, to give us some buffer time between calling the reclock function and whatever setup it does and the beginning of the actual vblank period.
Did you play with this some more?
Is this possible reclocking memory in wrong moment (so missing VBLANK probably) cause lock up? I experienced few already, when I forced myself to use this code ignoring corruptions. Any other idea what can cause lock up? I'm 100% sure it's memory reclocking code related.
Signature · 13 lines
Rafał ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
2010/3/26 Rafał Miłecki <[email protected]>:
Quoted 25 lines
W dniu 18 marca 2010 17:40 użytkownik Alex Deucher
Quoted 16 lines · <[email protected]> napisał:
2010/3/18 Rafał Miłecki <[email protected]>:
Quoted 8 lines
Quoted 1 line · W dniu 18 marca 2010 10:05 użytkownik Rafał Miłecki <[email protected]> napisał:
Whoops, I missed one patch. My mistake.
I've just applied all patches dated as "17-Mar-2010 22:42" and tested.
Now memory reclocking is really enabled, but it causes corruptions for me. Maybe that's the same thing you experienced with dual head?
Quoted 6 lines
Video is *far* from perfect, but maybe will give you some idea of what do I experience:
http://estudent.put.poznan.pl/rafal.milecki/kernel/MOV00225.MP4The same happened for me before all your patches, when I tried to enable memory reclocking on my own.
Quoted 6 lines
yeah, the similar to what I saw with dualhead. I guess we are either missing the vblank window or the reclock is taking too much time. I wonder if it would make sense to wait for a vline rather than vblank, say a vline 1/2 or 2/3 of the way down the screen, to give us some buffer time between calling the reclock function and whatever setup it does and the beginning of the actual vblank period.
Quoted 6 lines
Did you play with this some more?
Is this possible reclocking memory in wrong moment (so missing VBLANK probably) cause lock up? I experienced few already, when I forced myself to use this code ignoring corruptions. Any other idea what can cause lock up? I'm 100% sure it's memory reclocking code related.
I get occasional lockups as well with the memory reclock. I suspect we may have to disable crtc mem requests when changing the mclk, but I haven't really had a change to play more with this. Matthew's been looking it some more this week.
Alex
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
Quoted 4 lines · Rafał Miłecki
Is this possible reclocking memory in wrong moment (so missing VBLANK probably) cause lock up? I experienced few already, when I forced myself to use this code ignoring corruptions. Any other idea what can cause lock up? I'm 100% sure it's memory reclocking code related.
The first thing is that memory reclocking is definitely missing vblank occasionally - but sometimes that's because the interrupt fires before we get there, and sometimes it's because we're scheduled later. I have some fixes for that. Other corruption is likely to be due to the engine reclocking, which seems to also need to be done in vblank.
As far as the lockups go, I think this is due to memory access during reclock. Nothing should be coming from the cp, but we may be getting accesses from the crtc if we miss vblank (there's a bit in the crtc control that can deal with this), but more importantly we're doing nothing to prevent unaccelerated fallbacks touching vram during reclock. I can provoke lockups more easily using x11perf which probably triggers several of those, so I lean towards that being something we need to fix before looking for other potential issues.
Signature · 13 lines
Matthew Garrett | [email protected] ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
Quoted 9 lines · Matthew Garrett
As far as the lockups go, I think this is due to memory access during reclock. Nothing should be coming from the cp, but we may be getting accesses from the crtc if we miss vblank (there's a bit in the crtc control that can deal with this), but more importantly we're doing nothing to prevent unaccelerated fallbacks touching vram during reclock. I can provoke lockups more easily using x11perf which probably triggers several of those, so I lean towards that being something we need to fix before looking for other potential issues.
Have you tried making RADEONPrepareAccess_CS() in the X driver always return FALSE (you may also need to prevent RADEONUploadToScreenCS() from returning FALSE if the BO isn't busy) to confirm this? That should prevent any direct CPU access to VRAM, at least as long as you don't hit any software fallbacks in the 3D driver.
Signature · 14 lines
Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel