<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>ok, I get it, will change soon.<br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>发件人:</b> Deucher, Alexander<br>
<b>发送时间:</b> 2016年7月12日 10:44<br>
<b>收件人:</b> Wang, Qingqing; amd-gfx@lists.freedesktop.org<br>
<b>抄送:</b> Wang, Qingqing<br>
<b>主题:</b> RE: [PATCH v2] drm/amdgpu: fix power distribution issue for Polaris10 XT</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">> -----Original Message-----<br>
> From: amd-gfx [<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">mailto:amd-gfx-bounces@lists.freedesktop.org</a>] On Behalf<br>
> Of Ken Wang<br>
> Sent: Monday, July 11, 2016 10:39 PM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Wang, Qingqing<br>
> Subject: [PATCH v2] drm/amdgpu: fix power distribution issue for Polaris10<br>
> XT<br>
> <br>
> Change-Id: I8676174acd3273dd8dccc72ecc1d54e9626bdb71<br>
> Signed-off-by: Ken Wang <Qingqing.Wang@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/atombios_i2c.c | 15 +++++++++++++++<br>
> drivers/gpu/drm/amd/amdgpu/atombios_i2c.h | 1 +<br>
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 5 +++++<br>
> 3 files changed, 21 insertions(+)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c<br>
> b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c<br>
> index 13cdb01..145d752 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c<br>
> @@ -156,3 +156,18 @@ u32 amdgpu_atombios_i2c_func(struct i2c_adapter<br>
> *adap)<br>
> return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;<br>
> }<br>
> <br>
> +void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev,<br>
> u8 offset, u8 data)<br>
> +{<br>
> + PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION args;<br>
> + int index = GetIndexIntoMasterTable(COMMAND,<br>
> ProcessI2cChannelTransaction);<br>
> +<br>
> + args.ucRegIndex = offset;<br>
> + args.lpI2CDataOut = data;<br>
> + args.ucFlag = 1;<br>
> + args.ucI2CSpeed = TARGET_HW_I2C_CLOCK;<br>
> + args.ucTransBytes = 1;<br>
> + args.ucSlaveAddr = 0x10;<br>
> + args.ucLineNumber = 0x96;<br>
> +<br>
> + amdgpu_atom_execute_table(adev->mode_info.atom_context,<br>
> index, (uint32_t *)&args);<br>
> +}<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h<br>
> b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h<br>
> index d6128d9d..d31344f 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.h<br>
> @@ -27,5 +27,6 @@<br>
> int amdgpu_atombios_i2c_xfer(struct i2c_adapter *i2c_adap,<br>
> struct i2c_msg *msgs, int num);<br>
> u32 amdgpu_atombios_i2c_func(struct i2c_adapter *adap);<br>
> +void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev,<br>
> u8 offset, u8 data);<br>
<br>
channel_trans isn't much better than the previous name. How about something like amdgpu_atombios_i2c_set_power_dist_reg() or something like that?<br>
<br>
Alex<br>
<br>
> <br>
> #endif<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> index dbef1ed..362eab7 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c<br>
> @@ -28,6 +28,7 @@<br>
> #include "vid.h"<br>
> #include "amdgpu_ucode.h"<br>
> #include "amdgpu_atombios.h"<br>
> +#include "atombios_i2c.h"<br>
> #include "clearstate_vi.h"<br>
> <br>
> #include "gmc/gmc_8_2_d.h"<br>
> @@ -693,6 +694,10 @@ static void gfx_v8_0_init_golden_registers(struct<br>
> amdgpu_device *adev)<br>
> amdgpu_program_register_sequence(adev,<br>
> <br>
> polaris10_golden_common_all,<br>
> (const<br>
> u32)ARRAY_SIZE(polaris10_golden_common_all));<br>
> + if (adev->pdev->revision == 0xc7) {<br>
> + amdgpu_atombios_i2c_channel_trans(adev, 0x1E,<br>
> 0xDD);<br>
> + amdgpu_atombios_i2c_channel_trans(adev, 0x1F,<br>
> 0xD0);<br>
> + }<br>
> break;<br>
> case CHIP_CARRIZO:<br>
> amdgpu_program_register_sequence(adev,<br>
> --<br>
> 2.7.4<br>
> <br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</body>
</html>