All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
@ 2017-01-26 11:44 Chris Wilson
  2017-01-26 12:46 ` Ville Syrjälä
  2017-01-26 14:28 ` Deucher, Alexander
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-26 11:44 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher, Daniel Vetter

Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler
has been able to get smarter and spots that drm_mode_copy() is trying to
preserve garbage from the stack.

Fixes: 196cd5d3758c ("drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/drm_modes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 73ed6399c3fb..a8616b1a8d22 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
 void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
 			    int *hdisplay, int *vdisplay)
 {
-	struct drm_display_mode adjusted;
+	struct drm_display_mode adjusted = *mode;
 
-	drm_mode_copy(&adjusted, mode);
 	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
 	*hdisplay = adjusted.crtc_hdisplay;
 	*vdisplay = adjusted.crtc_vdisplay;
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
  2017-01-26 11:44 [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings() Chris Wilson
@ 2017-01-26 12:46 ` Ville Syrjälä
  2017-01-26 15:54   ` Daniel Vetter
  2017-01-26 14:28 ` Deucher, Alexander
  1 sibling, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2017-01-26 12:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Alex Deucher, Daniel Vetter, dri-devel

On Thu, Jan 26, 2017 at 11:44:09AM +0000, Chris Wilson wrote:
> Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler
> has been able to get smarter and spots that drm_mode_copy() is trying to
> preserve garbage from the stack.
> 
> Fixes: 196cd5d3758c ("drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/drm_modes.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 73ed6399c3fb..a8616b1a8d22 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
>  void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
>  			    int *hdisplay, int *vdisplay)
>  {
> -	struct drm_display_mode adjusted;
> +	struct drm_display_mode adjusted = *mode;
>  
> -	drm_mode_copy(&adjusted, mode);
>  	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
>  	*hdisplay = adjusted.crtc_hdisplay;
>  	*vdisplay = adjusted.crtc_vdisplay;
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
  2017-01-26 11:44 [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings() Chris Wilson
  2017-01-26 12:46 ` Ville Syrjälä
@ 2017-01-26 14:28 ` Deucher, Alexander
  1 sibling, 0 replies; 5+ messages in thread
From: Deucher, Alexander @ 2017-01-26 14:28 UTC (permalink / raw)
  To: 'Chris Wilson', dri-devel; +Cc: Daniel Vetter

> -----Original Message-----
> From: Chris Wilson [mailto:chris.ickle.wilson@gmail.com] On Behalf Of Chris
> Wilson
> Sent: Thursday, January 26, 2017 6:44 AM
> To: dri-devel@lists.freedesktop.org
> Cc: Chris Wilson; Daniel Vetter; Deucher, Alexander
> Subject: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
> 
> Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler
> has been able to get smarter and spots that drm_mode_copy() is trying to
> preserve garbage from the stack.
> 
> Fixes: 196cd5d3758c ("drm:
> s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/drm_modes.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 73ed6399c3fb..a8616b1a8d22 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
>  void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
>  			    int *hdisplay, int *vdisplay)
>  {
> -	struct drm_display_mode adjusted;
> +	struct drm_display_mode adjusted = *mode;
> 
> -	drm_mode_copy(&adjusted, mode);
>  	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
>  	*hdisplay = adjusted.crtc_hdisplay;
>  	*vdisplay = adjusted.crtc_vdisplay;
> --
> 2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
  2017-01-26 12:46 ` Ville Syrjälä
@ 2017-01-26 15:54   ` Daniel Vetter
  2017-01-26 19:13     ` Ville Syrjälä
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2017-01-26 15:54 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Alex Deucher, Daniel Vetter, dri-devel

On Thu, Jan 26, 2017 at 02:46:55PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 26, 2017 at 11:44:09AM +0000, Chris Wilson wrote:
> > Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler
> > has been able to get smarter and spots that drm_mode_copy() is trying to
> > preserve garbage from the stack.
> > 
> > Fixes: 196cd5d3758c ("drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Could have directly pushed to drm-misc-next ... *hint*

Thanks for patch&review, applied.
-Daniel

> 
> > ---
> >  drivers/gpu/drm/drm_modes.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index 73ed6399c3fb..a8616b1a8d22 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
> >  void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
> >  			    int *hdisplay, int *vdisplay)
> >  {
> > -	struct drm_display_mode adjusted;
> > +	struct drm_display_mode adjusted = *mode;
> >  
> > -	drm_mode_copy(&adjusted, mode);
> >  	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
> >  	*hdisplay = adjusted.crtc_hdisplay;
> >  	*vdisplay = adjusted.crtc_vdisplay;
> > -- 
> > 2.11.0
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> 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] 5+ messages in thread

* Re: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
  2017-01-26 15:54   ` Daniel Vetter
@ 2017-01-26 19:13     ` Ville Syrjälä
  0 siblings, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2017-01-26 19:13 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Alex Deucher, Daniel Vetter, dri-devel

On Thu, Jan 26, 2017 at 04:54:37PM +0100, Daniel Vetter wrote:
> On Thu, Jan 26, 2017 at 02:46:55PM +0200, Ville Syrjälä wrote:
> > On Thu, Jan 26, 2017 at 11:44:09AM +0000, Chris Wilson wrote:
> > > Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler
> > > has been able to get smarter and spots that drm_mode_copy() is trying to
> > > preserve garbage from the stack.
> > > 
> > > Fixes: 196cd5d3758c ("drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/")
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Daniel Vetter <daniel.vetter@intel.com>
> > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > 
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Could have directly pushed to drm-misc-next ... *hint*

That would miss the chance for some good bikeshedding ;)

> 
> Thanks for patch&review, applied.
> -Daniel
> 
> > 
> > > ---
> > >  drivers/gpu/drm/drm_modes.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > > index 73ed6399c3fb..a8616b1a8d22 100644
> > > --- a/drivers/gpu/drm/drm_modes.c
> > > +++ b/drivers/gpu/drm/drm_modes.c
> > > @@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
> > >  void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
> > >  			    int *hdisplay, int *vdisplay)
> > >  {
> > > -	struct drm_display_mode adjusted;
> > > +	struct drm_display_mode adjusted = *mode;
> > >  
> > > -	drm_mode_copy(&adjusted, mode);
> > >  	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
> > >  	*hdisplay = adjusted.crtc_hdisplay;
> > >  	*vdisplay = adjusted.crtc_vdisplay;
> > > -- 
> > > 2.11.0
> > > 
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> > 
> > -- 
> > Ville Syrjälä
> > Intel OTC
> > _______________________________________________
> > 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

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-26 19:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 11:44 [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings() Chris Wilson
2017-01-26 12:46 ` Ville Syrjälä
2017-01-26 15:54   ` Daniel Vetter
2017-01-26 19:13     ` Ville Syrjälä
2017-01-26 14:28 ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.