Skip to contentSkip to conversation

drm/amd/display: Adjust get_value function with prefix to help in ftrace

PATCH RESEND Superseded Leonardo Gomes 3 participants 7 messages May 14, 2025 – May 17, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/2 drm/amd/display: Adjust get_value function with prefix to help in ftrace

Adjust get_value function in hw_hpd.c file to have prefix to help in ftrace, the name change from 'get_value' to 'dal_hw_gpio_get_value'

---
 drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +2 -2
index 3f13a744d07d..b11ed1089589 100644
@@ -62,7 +62,7 @@ static void dal_hw_hpd_destroy(
 	*ptr = NULL;
 }
 
-static enum gpio_result get_value(
+static enum gpio_result dal_hw_gpio_get_value(
 	const struct hw_gpio_pin *ptr,
 	uint32_t *value)
 {
@@ -104,7 +104,7 @@ static enum gpio_result set_config(
 static const struct hw_gpio_pin_funcs funcs = {
 	.destroy = dal_hw_hpd_destroy,
 	.open = dal_hw_gpio_open,
-	.get_value = get_value,
+	.get_value = dal_hw_gpio_get_value,
 	.set_value = dal_hw_gpio_set_value,
 	.set_config = set_config,
 	.change_mode = dal_hw_gpio_change_mode,
Signature · 1 line
2.43.0
#1 lore raw

PATCH RESEND 2/2 drm/amd/display: Adjust set_value function with prefix to help in ftrace

Adjust set_value function in hw_hpd.c file to have prefix to help in ftrace, the name change from 'set_value' to 'dal_hw_gpio_set_value'

---
 drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +2 -2
index b11ed1089589..03e773136189 100644
@@ -85,7 +85,7 @@ static enum gpio_result dal_hw_gpio_get_value(
 	return dal_hw_gpio_get_value(ptr, value);
 }
 
-static enum gpio_result set_config(
+static enum gpio_result dal_hw_gpio_set_config(
 	struct hw_gpio_pin *ptr,
 	const struct gpio_config_data *config_data)
 {
@@ -106,7 +106,7 @@ static const struct hw_gpio_pin_funcs funcs = {
 	.open = dal_hw_gpio_open,
 	.get_value = dal_hw_gpio_get_value,
 	.set_value = dal_hw_gpio_set_value,
-	.set_config = set_config,
+	.set_config = dal_hw_gpio_set_config,
 	.change_mode = dal_hw_gpio_change_mode,
 	.close = dal_hw_gpio_close,
 };
Signature · 1 line
2.43.0
#2 lore raw
In reply to Leonardo Gomes
Quoted 4 lines · Leonardo Gomes

Adjust get_value function in hw_hpd.c file to have prefix to help in ftrace, the name change from 'get_value' to 'dal_hw_gpio_get_value'

This won't compile. dal_hw_gpio_get_value is already defined in drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c.

Alex

Quoted 33 lines
---
 drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +2 -3
index 3f13a744d07d..b11ed1089589 100644
@@ -62,7 +62,7 @@ static void dal_hw_hpd_destroy(
        *ptr = NULL;
 }
 
-static enum gpio_result get_value(
+static enum gpio_result dal_hw_gpio_get_value(
        const struct hw_gpio_pin *ptr,
        uint32_t *value)
 {
@@ -104,7 +104,7 @@ static enum gpio_result set_config(
 static const struct hw_gpio_pin_funcs funcs = {
        .destroy = dal_hw_hpd_destroy,
        .open = dal_hw_gpio_open,
-       .get_value = get_value,
+       .get_value = dal_hw_gpio_get_value,
        .set_value = dal_hw_gpio_set_value,
        .set_config = set_config,
        .change_mode = dal_hw_gpio_change_mode,
--

2.43.0

#3 lore raw

Thanks for your reply Alex,

I just realize with your comment that *drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c* import *dal_hw_gpio_get_value *and *dal_hw_gpio_set_value*.
So to make those functions inside *drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c* more clear what do you think to change them to *dal_hw_hpd_get_config* and *dal_hw_hpd_set_config*, making clear that this is a function from the file hw_hpd?

Leonardo Gomes

Em qua., 14 de mai. de 2025 às 18:08, Alex Deucher <[email protected]> escreveu:

Quoted 47 lines
Quoted 4 lines · Leonardo Gomes

Adjust get_value function in hw_hpd.c file to have prefix to help in ftrace, the name change from 'get_value' to 'dal_hw_gpio_get_value'

This won't compile. dal_hw_gpio_get_value is already defined in drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c.

Alex

Review

Quoted 9 lines
---
 drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c

Quoted 24 lines

index 3f13a744d07d..b11ed1089589 100644

drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +2 -3
@@ -62,7 +62,7 @@ static void dal_hw_hpd_destroy(
        *ptr = NULL;
 }
 
-static enum gpio_result get_value(
+static enum gpio_result dal_hw_gpio_get_value(
        const struct hw_gpio_pin *ptr,
        uint32_t *value)
 {
@@ -104,7 +104,7 @@ static enum gpio_result set_config(
 static const struct hw_gpio_pin_funcs funcs = {
        .destroy = dal_hw_hpd_destroy,
        .open = dal_hw_gpio_open,
-       .get_value = get_value,
+       .get_value = dal_hw_gpio_get_value,
        .set_value = dal_hw_gpio_set_value,
        .set_config = set_config,
        .change_mode = dal_hw_gpio_change_mode,
--

2.43.0

#4 lore raw
Quoted 6 lines · Leonardo Gomes

Thanks for your reply Alex,

I just realize with your comment that drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c import dal_hw_gpio_get_value and dal_hw_gpio_set_value.
So to make those functions inside drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c more clear what do you think to change them to dal_hw_hpd_get_config and dal_hw_hpd_set_config, making clear that this is a function from the file hw_hpd?

Right. It needs a different name to avoid the conflict with the other function.

Alex

Quoted 49 lines

Leonardo Gomes

Em qua., 14 de mai. de 2025 às 18:08, Alex Deucher <[email protected]> escreveu:

Quoted 46 lines
Quoted 4 lines · Leonardo Gomes

Adjust get_value function in hw_hpd.c file to have prefix to help in ftrace, the name change from 'get_value' to 'dal_hw_gpio_get_value'

This won't compile. dal_hw_gpio_get_value is already defined in drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c.

Alex

Quoted 33 lines
---
 drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +2 -3
index 3f13a744d07d..b11ed1089589 100644
@@ -62,7 +62,7 @@ static void dal_hw_hpd_destroy(
        *ptr = NULL;
 }
 
-static enum gpio_result get_value(
+static enum gpio_result dal_hw_gpio_get_value(
        const struct hw_gpio_pin *ptr,
        uint32_t *value)
 {
@@ -104,7 +104,7 @@ static enum gpio_result set_config(
 static const struct hw_gpio_pin_funcs funcs = {
        .destroy = dal_hw_hpd_destroy,
        .open = dal_hw_gpio_open,
-       .get_value = get_value,
+       .get_value = dal_hw_gpio_get_value,
        .set_value = dal_hw_gpio_set_value,
        .set_config = set_config,
        .change_mode = dal_hw_gpio_change_mode,
--

2.43.0

#5 lore raw

Good morning Alex,

I just resend the patch with the name I`ve been suggesting, please let me know if you have any recommendation.
And thanks again for your reply 😄

Leonardo Gomes

Em sex., 16 de mai. de 2025 às 13:56, Alex Deucher <[email protected]> escreveu:

Quoted 71 lines
Quoted 4 lines · Leonardo Gomes

Thanks for your reply Alex,

I just realize with your comment that

drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c import dal_hw_gpio_get_value and dal_hw_gpio_set_value.

Quoted 1 line

So to make those functions inside

drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c more clear what do you think to change them to dal_hw_hpd_get_config and dal_hw_hpd_set_config, making clear that this is a function from the file hw_hpd?

Quoted 1 line

Right. It needs a different name to avoid the conflict with the other function.

Alex

Quoted 3 lines

Leonardo Gomes

Em qua., 14 de mai. de 2025 às 18:08, Alex Deucher <

[email protected]> escreveu:

Quoted 14 lines
Quoted 14 lines
Quoted 4 lines · Leonardo Gomes

Adjust get_value function in hw_hpd.c file to have prefix to help in ftrace, the name change from 'get_value' to 'dal_hw_gpio_get_value'

This won't compile. dal_hw_gpio_get_value is already defined in drivers/gpu/drm/amd/display/dc/gpio/hw_gpio.c.

Alex

Quoted 1 line
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines

index 3f13a744d07d..b11ed1089589 100644

drivers/gpu/drm/amd/display/dc/gpio/hw_hpd.c +2 -3
@@ -62,7 +62,7 @@ static void dal_hw_hpd_destroy(
        *ptr = NULL;
 }
 
-static enum gpio_result get_value(
+static enum gpio_result dal_hw_gpio_get_value(
        const struct hw_gpio_pin *ptr,
        uint32_t *value)
 {
@@ -104,7 +104,7 @@ static enum gpio_result set_config(
 static const struct hw_gpio_pin_funcs funcs = {
        .destroy = dal_hw_hpd_destroy,
        .open = dal_hw_gpio_open,
-       .get_value = get_value,
+       .get_value = dal_hw_gpio_get_value,
        .set_value = dal_hw_gpio_set_value,
        .set_config = set_config,
        .change_mode = dal_hw_gpio_change_mode,
--

2.43.0

#6 lore raw
In reply to Leonardo Gomes
kernel test robot noticed the following build errors:

Hi Leonardo,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-exynos/exynos-drm-next]
[also build test ERROR on linus/master drm/drm-next drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-misc/drm-misc-next drm-tip/drm-tip v6.15-rc6 next-20250515] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Leonardo-Gomes/drm-amd-display-Adjust-set_value-function-with-prefix-to-help-in-ftrace/20250515-151114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
patch link:    https://lore.kernel.org/r/20250514174306.82693-1-leonardodasigomes%40gmail.com
patch subject: [PATCH 1/2 RESEND] drm/amd/display: Adjust get_value function with prefix to help in ftrace
config: sparc-allmodconfig (https://download.01.org/0day-ci/archive/20250516/[email protected]/config)
compiler: sparc64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250516/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_hpd.c:65:25: error: static declaration of 'dal_hw_gpio_get_value' follows non-static declaration
      65 | static enum gpio_result dal_hw_gpio_get_value(
         |                         ^~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_hpd.c:30:
   drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_gpio.h:122:18: note: previous declaration of 'dal_hw_gpio_get_value' with type 'enum gpio_result(const struct hw_gpio_pin *, uint32_t *)' {aka 'enum gpio_result(const struct hw_gpio_pin *, unsigned int *)'}
     122 | enum gpio_result dal_hw_gpio_get_value(
         |                  ^~~~~~~~~~~~~~~~~~~~~

vim +/dal_hw_gpio_get_value +65 drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_hpd.c

    64	
  > 65	static enum gpio_result dal_hw_gpio_get_value(
    66		const struct hw_gpio_pin *ptr,
    67		uint32_t *value)
    68	{
    69		struct hw_hpd *hpd = HW_HPD_FROM_BASE(ptr);
    70		uint32_t hpd_delayed = 0;
    71	
    72		/* in Interrupt mode we ask for SENSE bit */
    73	
    74		if (ptr->mode == GPIO_MODE_INTERRUPT) {
    75	
    76			REG_GET(int_status,
    77				DC_HPD_SENSE_DELAYED, &hpd_delayed);
    78	
    79			*value = hpd_delayed;
    80			return GPIO_RESULT_OK;
    81		}
    82	
    83		/* in any other modes, operate as normal GPIO */
    84	
    85		return dal_hw_gpio_get_value(ptr, value);
    86	}
    87	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki