* [PATCH] drm/sun4i: Eliminate pointless on stack copy of drm_display_info
@ 2019-03-26 17:38 Ville Syrjala
2019-03-26 18:09 ` Maxime Ripard
2019-03-26 18:16 ` Daniel Vetter
0 siblings, 2 replies; 3+ messages in thread
From: Ville Syrjala @ 2019-03-26 17:38 UTC (permalink / raw)
To: dri-devel; +Cc: Maxime Ripard
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Just use a pointer to the display_info rather than make a copy
on stack.
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index fa92e992a282..7ac46483ee78 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -482,7 +482,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
const struct drm_display_mode *mode)
{
struct drm_connector *connector = sun4i_tcon_get_connector(encoder);
- struct drm_display_info display_info = connector->display_info;
+ const struct drm_display_info *info = &connector->display_info;
unsigned int bp, hsync, vsync;
u8 clk_delay;
u32 val = 0;
@@ -543,7 +543,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
if (mode->flags & DRM_MODE_FLAG_PVSYNC)
val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
- if (display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
+ if (info->bus_flags & DRM_BUS_FLAG_DE_LOW)
val |= SUN4I_TCON0_IO_POL_DE_NEGATIVE;
/*
@@ -561,10 +561,10 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
* Following code is a way to avoid quirks all around TCON
* and DOTCLOCK drivers.
*/
- if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
+ if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
clk_set_phase(tcon->dclk, 240);
- if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
+ if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
clk_set_phase(tcon->dclk, 0);
regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG,
--
2.19.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/sun4i: Eliminate pointless on stack copy of drm_display_info
2019-03-26 17:38 [PATCH] drm/sun4i: Eliminate pointless on stack copy of drm_display_info Ville Syrjala
@ 2019-03-26 18:09 ` Maxime Ripard
2019-03-26 18:16 ` Daniel Vetter
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2019-03-26 18:09 UTC (permalink / raw)
To: Ville Syrjala; +Cc: dri-devel
On Tue, Mar 26, 2019 at 07:38:10PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Just use a pointer to the display_info rather than make a copy
> on stack.
>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/sun4i: Eliminate pointless on stack copy of drm_display_info
2019-03-26 17:38 [PATCH] drm/sun4i: Eliminate pointless on stack copy of drm_display_info Ville Syrjala
2019-03-26 18:09 ` Maxime Ripard
@ 2019-03-26 18:16 ` Daniel Vetter
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2019-03-26 18:16 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Maxime Ripard, dri-devel
On Tue, Mar 26, 2019 at 07:38:10PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Just use a pointer to the display_info rather than make a copy
> on stack.
>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index fa92e992a282..7ac46483ee78 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -482,7 +482,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> const struct drm_display_mode *mode)
> {
> struct drm_connector *connector = sun4i_tcon_get_connector(encoder);
> - struct drm_display_info display_info = connector->display_info;
> + const struct drm_display_info *info = &connector->display_info;
> unsigned int bp, hsync, vsync;
> u8 clk_delay;
> u32 val = 0;
> @@ -543,7 +543,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> if (mode->flags & DRM_MODE_FLAG_PVSYNC)
> val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
>
> - if (display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
> + if (info->bus_flags & DRM_BUS_FLAG_DE_LOW)
> val |= SUN4I_TCON0_IO_POL_DE_NEGATIVE;
>
> /*
> @@ -561,10 +561,10 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> * Following code is a way to avoid quirks all around TCON
> * and DOTCLOCK drivers.
> */
> - if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
> + if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
> clk_set_phase(tcon->dclk, 240);
>
> - if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
> + if (info->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
> clk_set_phase(tcon->dclk, 0);
>
> regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG,
> --
> 2.19.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-26 18:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 17:38 [PATCH] drm/sun4i: Eliminate pointless on stack copy of drm_display_info Ville Syrjala
2019-03-26 18:09 ` Maxime Ripard
2019-03-26 18:16 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).