* [PATCH 1/3] drm/radeon: Add new callback that exposes vddc
[not found] <20201008181606.460499-1-sandy.8925@gmail.com>
@ 2020-10-08 18:16 ` sandy.8925
2020-10-08 18:16 ` [PATCH 2/3] drm/radeon: Add implementation of get_current_vddc for Sumo sandy.8925
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: sandy.8925 @ 2020-10-08 18:16 UTC (permalink / raw)
To: alexander.deucher; +Cc: Sandeep Raghuraman, dri-devel
From: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
---
drivers/gpu/drm/radeon/radeon.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index cc4f58d16589..85a1cafdf303 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1992,6 +1992,7 @@ struct radeon_asic {
int (*get_fan_speed_percent)(struct radeon_device *rdev, u32 *speed);
u32 (*get_current_sclk)(struct radeon_device *rdev);
u32 (*get_current_mclk)(struct radeon_device *rdev);
+ u16 (*get_current_vddc)(struct radeon_device *rdev);
} dpm;
/* pageflipping */
struct {
--
2.28.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] drm/radeon: Add implementation of get_current_vddc for Sumo
[not found] <20201008181606.460499-1-sandy.8925@gmail.com>
2020-10-08 18:16 ` [PATCH 1/3] drm/radeon: Add new callback that exposes vddc sandy.8925
@ 2020-10-08 18:16 ` sandy.8925
2020-10-08 18:16 ` [PATCH 3/3] drm/radeon: Expose vddc through hwmon sandy.8925
2020-10-09 6:47 ` Thomas Zimmermann
3 siblings, 0 replies; 8+ messages in thread
From: sandy.8925 @ 2020-10-08 18:16 UTC (permalink / raw)
To: alexander.deucher; +Cc: Sandeep Raghuraman, dri-devel
From: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
---
drivers/gpu/drm/radeon/radeon_asic.c | 1 +
drivers/gpu/drm/radeon/radeon_asic.h | 1 +
drivers/gpu/drm/radeon/sumo_dpm.c | 20 ++++++++++++++++++++
3 files changed, 22 insertions(+)
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index 495700d16fc9..8becbe09af2f 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1513,6 +1513,7 @@ static struct radeon_asic sumo_asic = {
.force_performance_level = &sumo_dpm_force_performance_level,
.get_current_sclk = &sumo_dpm_get_current_sclk,
.get_current_mclk = &sumo_dpm_get_current_mclk,
+ .get_current_vddc = &sumo_dpm_get_current_vddc,
},
.pflip = {
.page_flip = &evergreen_page_flip,
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index a74fa18cd27b..24644daead53 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -596,6 +596,7 @@ int sumo_dpm_force_performance_level(struct radeon_device *rdev,
enum radeon_dpm_forced_level level);
u32 sumo_dpm_get_current_sclk(struct radeon_device *rdev);
u32 sumo_dpm_get_current_mclk(struct radeon_device *rdev);
+u16 sumo_dpm_get_current_vddc(struct radeon_device *rdev);
/*
* cayman
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index b95d5d390caf..f74f381af05f 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1865,6 +1865,26 @@ u32 sumo_dpm_get_current_mclk(struct radeon_device *rdev)
return pi->sys_info.bootup_uma_clk;
}
+u16 sumo_dpm_get_current_vddc(struct radeon_device *rdev)
+{
+ struct sumo_power_info *pi = sumo_get_pi(rdev);
+ struct radeon_ps *rps = &pi->current_rps;
+ struct sumo_ps *ps = sumo_get_ps(rps);
+ struct sumo_pl *pl;
+ u32 current_index =
+ (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURR_INDEX_MASK) >>
+ CURR_INDEX_SHIFT;
+
+ if (current_index == BOOST_DPM_LEVEL) {
+ pl = &pi->boost_pl;
+ } else if (current_index >= ps->num_levels) {
+ return 0;
+ } else {
+ pl = &ps->levels[current_index];
+ }
+ return sumo_convert_voltage_index_to_value(rdev, pl->vddc_index);
+}
+
void sumo_dpm_fini(struct radeon_device *rdev)
{
int i;
--
2.28.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] drm/radeon: Expose vddc through hwmon
[not found] <20201008181606.460499-1-sandy.8925@gmail.com>
2020-10-08 18:16 ` [PATCH 1/3] drm/radeon: Add new callback that exposes vddc sandy.8925
2020-10-08 18:16 ` [PATCH 2/3] drm/radeon: Add implementation of get_current_vddc for Sumo sandy.8925
@ 2020-10-08 18:16 ` sandy.8925
2020-10-09 6:47 ` Thomas Zimmermann
3 siblings, 0 replies; 8+ messages in thread
From: sandy.8925 @ 2020-10-08 18:16 UTC (permalink / raw)
To: alexander.deucher; +Cc: Sandeep Raghuraman, dri-devel
From: Sandeep Raghuraman <sandy.8925@gmail.com>
Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
---
drivers/gpu/drm/radeon/radeon_pm.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 05c4196a8212..65d172b13e06 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -737,6 +737,26 @@ static ssize_t radeon_hwmon_show_sclk(struct device *dev,
static SENSOR_DEVICE_ATTR(freq1_input, S_IRUGO, radeon_hwmon_show_sclk, NULL,
0);
+static ssize_t radeon_hwmon_show_vddc(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct radeon_device *rdev = dev_get_drvdata(dev);
+ struct drm_device *ddev = rdev->ddev;
+ u16 vddc = 0;
+
+ /* Can't get vddc when the card is off */
+ if ((rdev->flags & RADEON_IS_PX) &&
+ (ddev->switch_power_state != DRM_SWITCH_POWER_ON))
+ return -EINVAL;
+
+ if (rdev->asic->dpm.get_current_vddc)
+ vddc = rdev->asic->dpm.get_current_vddc(rdev);
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", vddc);
+}
+
+static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, radeon_hwmon_show_vddc, NULL,
+ 0);
static struct attribute *hwmon_attributes[] = {
&sensor_dev_attr_temp1_input.dev_attr.attr,
@@ -747,6 +767,7 @@ static struct attribute *hwmon_attributes[] = {
&sensor_dev_attr_pwm1_min.dev_attr.attr,
&sensor_dev_attr_pwm1_max.dev_attr.attr,
&sensor_dev_attr_freq1_input.dev_attr.attr,
+ &sensor_dev_attr_in0_input.dev_attr.attr,
NULL
};
@@ -765,7 +786,13 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_max.dev_attr.attr ||
attr == &sensor_dev_attr_pwm1_min.dev_attr.attr ||
- attr == &sensor_dev_attr_freq1_input.dev_attr.attr))
+ attr == &sensor_dev_attr_freq1_input.dev_attr.attr ||
+ attr == &sensor_dev_attr_in0_input.dev_attr.attr))
+ return 0;
+
+ /* Skip vddc attribute if get_current_vddc is not implemented */
+ if(attr == &sensor_dev_attr_in0_input.dev_attr.attr &&
+ !rdev->asic->dpm.get_current_vddc)
return 0;
/* Skip fan attributes if fan is not present */
--
2.28.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re:
[not found] <20201008181606.460499-1-sandy.8925@gmail.com>
` (2 preceding siblings ...)
2020-10-08 18:16 ` [PATCH 3/3] drm/radeon: Expose vddc through hwmon sandy.8925
@ 2020-10-09 6:47 ` Thomas Zimmermann
2020-10-09 7:14 ` Re: Thomas Zimmermann
3 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2020-10-09 6:47 UTC (permalink / raw)
To: sandy.8925, alexander.deucher; +Cc: dri-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 559 bytes --]
NACK for the entire lack of any form of commit description.
Am 08.10.20 um 20:16 schrieb sandy.8925@gmail.com:
> Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 516 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re:
2020-10-09 6:47 ` Thomas Zimmermann
@ 2020-10-09 7:14 ` Thomas Zimmermann
2020-10-09 7:38 ` Re: Sandeep Raghuraman
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2020-10-09 7:14 UTC (permalink / raw)
To: sandy.8925, alexander.deucher; +Cc: dri-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 1038 bytes --]
Hi
Am 09.10.20 um 08:47 schrieb Thomas Zimmermann:
> NACK for the entire lack of any form of commit description.
Please see the documentation at [1] on how to describe the changes and
getting your patches merged.
Best regards
Thomas
[1]
https://dri.freedesktop.org/docs/drm/process/submitting-patches.html#describe-your-changes
>
> Am 08.10.20 um 20:16 schrieb sandy.8925@gmail.com:
>> Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 516 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re:
2020-10-09 7:14 ` Re: Thomas Zimmermann
@ 2020-10-09 7:38 ` Sandeep Raghuraman
2020-10-09 7:51 ` Re: Thomas Zimmermann
0 siblings, 1 reply; 8+ messages in thread
From: Sandeep Raghuraman @ 2020-10-09 7:38 UTC (permalink / raw)
To: Thomas Zimmermann, alexander.deucher; +Cc: dri-devel
On 10/9/20 12:44 PM, Thomas Zimmermann wrote:
> Hi
>
> Am 09.10.20 um 08:47 schrieb Thomas Zimmermann:
>> NACK for the entire lack of any form of commit description.
>
> Please see the documentation at [1] on how to describe the changes and
> getting your patches merged.
Yes, I tried to use git send-email to send patches this time, and it resulted in this disaster. I'll stick to sending them through Thunderbird.
>
> Best regards
> Thomas
>
> [1]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re:
2020-10-09 7:38 ` Re: Sandeep Raghuraman
@ 2020-10-09 7:51 ` Thomas Zimmermann
2020-10-09 15:48 ` Re: Alex Deucher
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2020-10-09 7:51 UTC (permalink / raw)
To: Sandeep Raghuraman, alexander.deucher; +Cc: dri-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 1328 bytes --]
Hi
Am 09.10.20 um 09:38 schrieb Sandeep Raghuraman:
>
>
> On 10/9/20 12:44 PM, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 09.10.20 um 08:47 schrieb Thomas Zimmermann:
>>> NACK for the entire lack of any form of commit description.
>>
>> Please see the documentation at [1] on how to describe the changes and
>> getting your patches merged.
>
> Yes, I tried to use git send-email to send patches this time, and it resulted in this disaster. I'll stick to sending them through Thunderbird.
What's the problem with send-email?
A typical call for your patchset would look like
git send-mail <upstream-branch>...HEAD --cover-letter --annotate
--to=... --cc=...
That allows you to write the cover letter and have it sent out. IIRC you
need ot set $EDITOR to your favorite text editor; and configure the SMTP
server in ~/.gitconfig, under [sendemail].
Best regards
Thomas
>
>>
>> Best regards
>> Thomas
>>
>> [1]
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 516 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re:
2020-10-09 7:51 ` Re: Thomas Zimmermann
@ 2020-10-09 15:48 ` Alex Deucher
0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2020-10-09 15:48 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Deucher, Alexander, Sandeep Raghuraman, Maling list - DRI developers
On Fri, Oct 9, 2020 at 3:51 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
> Hi
>
> Am 09.10.20 um 09:38 schrieb Sandeep Raghuraman:
> >
> >
> > On 10/9/20 12:44 PM, Thomas Zimmermann wrote:
> >> Hi
> >>
> >> Am 09.10.20 um 08:47 schrieb Thomas Zimmermann:
> >>> NACK for the entire lack of any form of commit description.
> >>
> >> Please see the documentation at [1] on how to describe the changes and
> >> getting your patches merged.
> >
> > Yes, I tried to use git send-email to send patches this time, and it resulted in this disaster. I'll stick to sending them through Thunderbird.
>
> What's the problem with send-email?
>
> A typical call for your patchset would look like
>
> git send-mail <upstream-branch>...HEAD --cover-letter --annotate
> --to=... --cc=...
>
> That allows you to write the cover letter and have it sent out. IIRC you
> need ot set $EDITOR to your favorite text editor; and configure the SMTP
> server in ~/.gitconfig, under [sendemail].
>
You can also do `git format-patch -3 --cover-letter` and manually edit
the coverletter as needed then send them with git send-email.
Alex
> Best regards
> Thomas
>
> >
> >>
> >> Best regards
> >> Thomas
> >>
> >> [1]
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
>
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread