2020-09-22 03:10:21

by 赵军奎

[permalink] [raw]
Subject: [PATCH v2] drm/amd/display: optimize code runtime a bit

In the function dal_ddc_service_query_ddc_data,
get rid of dal_ddc_i2c_payloads_destroy, call
dal_vector_destruct() directly.
This change is to make the code run a bit fast.

Signed-off-by: Bernard Zhao <[email protected]>
Changes since V1:
*get rid of dal_ddc_i2c_payloads_destroy, call
dal_vector_destruct() directly.

Link for V1:
*https://lore.kernel.org/patchwork/patch/1309014/
---
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
index b984eecca58b..dec12de37642 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
@@ -148,14 +148,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p)
return p->payloads.count;
}

-static void dal_ddc_i2c_payloads_destroy(struct i2c_payloads *p)
-{
- if (!p)
- return;
-
- dal_vector_destruct(&p->payloads);
-}
-
#define DDC_MIN(a, b) (((a) < (b)) ? (a) : (b))

void dal_ddc_i2c_payloads_add(
@@ -582,7 +574,7 @@ bool dal_ddc_service_query_ddc_data(
ddc->link,
&command);

- dal_ddc_i2c_payloads_destroy(&payloads);
+ dal_vector_destruct(&payloads.payloads);
}

return success;
--
2.28.0


2020-09-22 15:44:12

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH v2] drm/amd/display: optimize code runtime a bit

Applied. Thanks!

Alex

On Tue, Sep 22, 2020 at 3:52 AM Bernard Zhao <[email protected]> wrote:
>
> In the function dal_ddc_service_query_ddc_data,
> get rid of dal_ddc_i2c_payloads_destroy, call
> dal_vector_destruct() directly.
> This change is to make the code run a bit fast.
>
> Signed-off-by: Bernard Zhao <[email protected]>
> Changes since V1:
> *get rid of dal_ddc_i2c_payloads_destroy, call
> dal_vector_destruct() directly.
>
> Link for V1:
> *https://lore.kernel.org/patchwork/patch/1309014/
> ---
> drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> index b984eecca58b..dec12de37642 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> @@ -148,14 +148,6 @@ static uint32_t dal_ddc_i2c_payloads_get_count(struct i2c_payloads *p)
> return p->payloads.count;
> }
>
> -static void dal_ddc_i2c_payloads_destroy(struct i2c_payloads *p)
> -{
> - if (!p)
> - return;
> -
> - dal_vector_destruct(&p->payloads);
> -}
> -
> #define DDC_MIN(a, b) (((a) < (b)) ? (a) : (b))
>
> void dal_ddc_i2c_payloads_add(
> @@ -582,7 +574,7 @@ bool dal_ddc_service_query_ddc_data(
> ddc->link,
> &command);
>
> - dal_ddc_i2c_payloads_destroy(&payloads);
> + dal_vector_destruct(&payloads.payloads);
> }
>
> return success;
> --
> 2.28.0
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel