* [PATCH] drm/TODO: Add vrefresh replacement to the todo
@ 2019-01-29 16:15 ` Sean Paul
0 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-29 16:15 UTC (permalink / raw)
To: dri-devel
Cc: daniel, Sean Paul, Maarten Lankhorst, Maxime Ripard, Sean Paul,
David Airlie, linux-doc
From: Sean Paul <seanpaul@chromium.org>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
Documentation/gpu/todo.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 38360ede12215..7fc30380eaf6c 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -262,6 +262,21 @@ As a reference, take a look at the conversions already completed in drm core.
Contact: Sean Paul, respective driver maintainers
+Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
+----------------------------------------------------------------
+
+drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
+is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
+has helper which will use mode.vrefresh if it's !0 and will calculate it from
+the timings when it's 0.
+
+Use simple search/replace, or (more fun) cocci to replace instances of direct
+vrefresh access with a call to the helper. Check out
+https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
+inspiration.
+
+Contact: Sean Paul
+
Core refactorings
=================
--
Sean Paul, Software Engineer, Google / Chromium OS
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] drm/TODO: Add vrefresh replacement to the todo
@ 2019-01-29 16:15 ` Sean Paul
0 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-29 16:15 UTC (permalink / raw)
To: dri-devel; +Cc: linux-doc, Maxime Ripard, David Airlie, Sean Paul, Sean Paul
From: Sean Paul <seanpaul@chromium.org>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
Documentation/gpu/todo.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 38360ede12215..7fc30380eaf6c 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -262,6 +262,21 @@ As a reference, take a look at the conversions already completed in drm core.
Contact: Sean Paul, respective driver maintainers
+Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
+----------------------------------------------------------------
+
+drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
+is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
+has helper which will use mode.vrefresh if it's !0 and will calculate it from
+the timings when it's 0.
+
+Use simple search/replace, or (more fun) cocci to replace instances of direct
+vrefresh access with a call to the helper. Check out
+https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
+inspiration.
+
+Contact: Sean Paul
+
Core refactorings
=================
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] drm/TODO: Add vrefresh replacement to the todo
2019-01-29 16:15 ` Sean Paul
@ 2019-01-29 16:28 ` Sam Ravnborg
-1 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2019-01-29 16:28 UTC (permalink / raw)
To: Sean Paul; +Cc: dri-devel, linux-doc, Maxime Ripard, David Airlie, Sean Paul
On Tue, Jan 29, 2019 at 11:15:51AM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> Documentation/gpu/todo.rst | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..7fc30380eaf6c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,21 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
Bonus points for the link!
Sam
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] drm/TODO: Add vrefresh replacement to the todo
@ 2019-01-29 16:28 ` Sam Ravnborg
0 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2019-01-29 16:28 UTC (permalink / raw)
To: Sean Paul; +Cc: Maxime Ripard, David Airlie, Sean Paul, dri-devel, linux-doc
On Tue, Jan 29, 2019 at 11:15:51AM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> Documentation/gpu/todo.rst | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..7fc30380eaf6c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,21 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
Bonus points for the link!
Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] drm/TODO: Add vrefresh replacement to the todo
2019-01-29 16:15 ` Sean Paul
@ 2019-01-29 16:35 ` Ville Syrjälä
-1 siblings, 0 replies; 14+ messages in thread
From: Ville Syrjälä @ 2019-01-29 16:35 UTC (permalink / raw)
To: Sean Paul; +Cc: dri-devel, linux-doc, Maxime Ripard, David Airlie, Sean Paul
On Tue, Jan 29, 2019 at 11:15:51AM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
> Documentation/gpu/todo.rst | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..7fc30380eaf6c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,21 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
I would suggest just nuking mode.vrefresh entirely because we
don't want to risk drm_mode_vrefresh() returning some stale
value.
> +
> +Contact: Sean Paul
> +
> Core refactorings
> =================
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] drm/TODO: Add vrefresh replacement to the todo
@ 2019-01-29 16:35 ` Ville Syrjälä
0 siblings, 0 replies; 14+ messages in thread
From: Ville Syrjälä @ 2019-01-29 16:35 UTC (permalink / raw)
To: Sean Paul; +Cc: Maxime Ripard, David Airlie, Sean Paul, dri-devel, linux-doc
On Tue, Jan 29, 2019 at 11:15:51AM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
> Documentation/gpu/todo.rst | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..7fc30380eaf6c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,21 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
I would suggest just nuking mode.vrefresh entirely because we
don't want to risk drm_mode_vrefresh() returning some stale
value.
> +
> +Contact: Sean Paul
> +
> Core refactorings
> =================
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] drm/TODO: Add vrefresh replacement to the todo
2019-01-29 16:35 ` Ville Syrjälä
@ 2019-01-29 16:45 ` Sean Paul
-1 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-29 16:45 UTC (permalink / raw)
To: dri-devel
Cc: daniel, Sean Paul, Ville Syrjälä,
Sam Ravnborg, David Airlie, Maarten Lankhorst, Maxime Ripard,
Sean Paul, linux-doc
From: Sean Paul <seanpaul@chromium.org>
Changes in v2:
- Add drm_display_mode.vrefresh removal (Ville)
- Add Sam's R-b and bonus points
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
Documentation/gpu/todo.rst | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 38360ede12215..1bbfc5e1b2a46 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -262,6 +262,24 @@ As a reference, take a look at the conversions already completed in drm core.
Contact: Sean Paul, respective driver maintainers
+Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
+----------------------------------------------------------------
+
+drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
+is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
+has helper which will use mode.vrefresh if it's !0 and will calculate it from
+the timings when it's 0.
+
+Use simple search/replace, or (more fun) cocci to replace instances of direct
+vrefresh access with a call to the helper. Check out
+https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
+inspiration.
+
+Once all instances of vrefresh have been converted, consider removing vrefresh
+from drm_display_mode to avoid future use.
+
+Contact: Sean Paul
+
Core refactorings
=================
--
Sean Paul, Software Engineer, Google / Chromium OS
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2] drm/TODO: Add vrefresh replacement to the todo
@ 2019-01-29 16:45 ` Sean Paul
0 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-29 16:45 UTC (permalink / raw)
To: dri-devel
Cc: linux-doc, David Airlie, Sean Paul, Maxime Ripard, Sean Paul,
Sam Ravnborg
From: Sean Paul <seanpaul@chromium.org>
Changes in v2:
- Add drm_display_mode.vrefresh removal (Ville)
- Add Sam's R-b and bonus points
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
Documentation/gpu/todo.rst | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 38360ede12215..1bbfc5e1b2a46 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -262,6 +262,24 @@ As a reference, take a look at the conversions already completed in drm core.
Contact: Sean Paul, respective driver maintainers
+Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
+----------------------------------------------------------------
+
+drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
+is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
+has helper which will use mode.vrefresh if it's !0 and will calculate it from
+the timings when it's 0.
+
+Use simple search/replace, or (more fun) cocci to replace instances of direct
+vrefresh access with a call to the helper. Check out
+https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
+inspiration.
+
+Once all instances of vrefresh have been converted, consider removing vrefresh
+from drm_display_mode to avoid future use.
+
+Contact: Sean Paul
+
Core refactorings
=================
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2] drm/TODO: Add vrefresh replacement to the todo
2019-01-29 16:45 ` Sean Paul
@ 2019-01-29 17:24 ` Daniel Vetter
-1 siblings, 0 replies; 14+ messages in thread
From: Daniel Vetter @ 2019-01-29 17:24 UTC (permalink / raw)
To: Sean Paul
Cc: dri-devel, daniel, Sean Paul, Ville Syrjälä,
Sam Ravnborg, David Airlie, Maarten Lankhorst, Maxime Ripard,
linux-doc
On Tue, Jan 29, 2019 at 11:45:10AM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Changes in v2:
> - Add drm_display_mode.vrefresh removal (Ville)
> - Add Sam's R-b and bonus points
hsync has the same problem, maybe add that too. With that:
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
> Documentation/gpu/todo.rst | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..1bbfc5e1b2a46 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,24 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
> +
> +Once all instances of vrefresh have been converted, consider removing vrefresh
> +from drm_display_mode to avoid future use.
> +
> +Contact: Sean Paul
> +
> Core refactorings
> =================
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] drm/TODO: Add vrefresh replacement to the todo
@ 2019-01-29 17:24 ` Daniel Vetter
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Vetter @ 2019-01-29 17:24 UTC (permalink / raw)
To: Sean Paul
Cc: linux-doc, David Airlie, dri-devel, Maxime Ripard, Sean Paul,
Sam Ravnborg
On Tue, Jan 29, 2019 at 11:45:10AM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Changes in v2:
> - Add drm_display_mode.vrefresh removal (Ville)
> - Add Sam's R-b and bonus points
hsync has the same problem, maybe add that too. With that:
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
> Documentation/gpu/todo.rst | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..1bbfc5e1b2a46 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,24 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
> +
> +Once all instances of vrefresh have been converted, consider removing vrefresh
> +from drm_display_mode to avoid future use.
> +
> +Contact: Sean Paul
> +
> Core refactorings
> =================
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>
--
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] 14+ messages in thread
* [PATCH v3] drm/TODO: Add drm_display_mode.hsync/vrefresh removal
2019-01-29 17:24 ` Daniel Vetter
@ 2019-01-29 19:26 ` Sean Paul
-1 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-29 19:26 UTC (permalink / raw)
To: dri-devel
Cc: daniel, Sean Paul, Ville Syrjälä,
Sam Ravnborg, Maarten Lankhorst, Maxime Ripard, Sean Paul,
David Airlie, linux-doc
From: Sean Paul <seanpaul@chromium.org>
Drivers shouldn't be using these values, add a TODO so someone removes
them.
Changes in v2:
- Add drm_display_mode.vrefresh removal (Ville)
- Add Sam's R-b and bonus points
Changes in v3:
- Add hsync removal todo item (Daniel)
- Change vrefresh wording to make removal less optional
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
This time with feeling.
Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 38360ede12215..f67c84b92873c 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -262,6 +262,34 @@ As a reference, take a look at the conversions already completed in drm core.
Contact: Sean Paul, respective driver maintainers
+Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
+----------------------------------------------------------------
+
+drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
+is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
+has helper which will use mode.vrefresh if it's !0 and will calculate it from
+the timings when it's 0.
+
+Use simple search/replace, or (more fun) cocci to replace instances of direct
+vrefresh access with a call to the helper. Check out
+https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
+inspiration.
+
+Once all instances of vrefresh have been converted, remove vrefresh from
+drm_display_mode to avoid future use.
+
+Contact: Sean Paul
+
+Remove drm_display_mode.hsync
+-----------------------------
+
+We have drm_mode_hsync() to calculate this from hsync_start/end, since drivers
+shouldn't/don't use this, remove this member to avoid any temptations to use it
+in the future. If there is any debug code using drm_display_mode.hsync, convert
+it to use drm_mode_hsync() instead.
+
+Contact: Sean Paul
+
Core refactorings
=================
--
Sean Paul, Software Engineer, Google / Chromium OS
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v3] drm/TODO: Add drm_display_mode.hsync/vrefresh removal
@ 2019-01-29 19:26 ` Sean Paul
0 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-29 19:26 UTC (permalink / raw)
To: dri-devel
Cc: linux-doc, Maxime Ripard, Sean Paul, David Airlie, Sean Paul,
Sam Ravnborg
From: Sean Paul <seanpaul@chromium.org>
Drivers shouldn't be using these values, add a TODO so someone removes
them.
Changes in v2:
- Add drm_display_mode.vrefresh removal (Ville)
- Add Sam's R-b and bonus points
Changes in v3:
- Add hsync removal todo item (Daniel)
- Change vrefresh wording to make removal less optional
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
This time with feeling.
Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 38360ede12215..f67c84b92873c 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -262,6 +262,34 @@ As a reference, take a look at the conversions already completed in drm core.
Contact: Sean Paul, respective driver maintainers
+Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
+----------------------------------------------------------------
+
+drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
+is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
+has helper which will use mode.vrefresh if it's !0 and will calculate it from
+the timings when it's 0.
+
+Use simple search/replace, or (more fun) cocci to replace instances of direct
+vrefresh access with a call to the helper. Check out
+https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
+inspiration.
+
+Once all instances of vrefresh have been converted, remove vrefresh from
+drm_display_mode to avoid future use.
+
+Contact: Sean Paul
+
+Remove drm_display_mode.hsync
+-----------------------------
+
+We have drm_mode_hsync() to calculate this from hsync_start/end, since drivers
+shouldn't/don't use this, remove this member to avoid any temptations to use it
+in the future. If there is any debug code using drm_display_mode.hsync, convert
+it to use drm_mode_hsync() instead.
+
+Contact: Sean Paul
+
Core refactorings
=================
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v3] drm/TODO: Add drm_display_mode.hsync/vrefresh removal
2019-01-29 19:26 ` Sean Paul
@ 2019-01-31 19:09 ` Sean Paul
-1 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-31 19:09 UTC (permalink / raw)
To: dri-devel
Cc: daniel, Sean Paul, Ville Syrjälä,
Sam Ravnborg, Maarten Lankhorst, Maxime Ripard, Sean Paul,
David Airlie, linux-doc
On Tue, Jan 29, 2019 at 02:26:29PM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Drivers shouldn't be using these values, add a TODO so someone removes
> them.
>
> Changes in v2:
> - Add drm_display_mode.vrefresh removal (Ville)
> - Add Sam's R-b and bonus points
> Changes in v3:
> - Add hsync removal todo item (Daniel)
> - Change vrefresh wording to make removal less optional
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
And applied to -misc-next.
Thanks for the reviews, all.
Sean
> ---
>
> This time with feeling.
>
> Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..f67c84b92873c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,34 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
> +
> +Once all instances of vrefresh have been converted, remove vrefresh from
> +drm_display_mode to avoid future use.
> +
> +Contact: Sean Paul
> +
> +Remove drm_display_mode.hsync
> +-----------------------------
> +
> +We have drm_mode_hsync() to calculate this from hsync_start/end, since drivers
> +shouldn't/don't use this, remove this member to avoid any temptations to use it
> +in the future. If there is any debug code using drm_display_mode.hsync, convert
> +it to use drm_mode_hsync() instead.
> +
> +Contact: Sean Paul
> +
> Core refactorings
> =================
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>
--
Sean Paul, Software Engineer, Google / Chromium OS
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v3] drm/TODO: Add drm_display_mode.hsync/vrefresh removal
@ 2019-01-31 19:09 ` Sean Paul
0 siblings, 0 replies; 14+ messages in thread
From: Sean Paul @ 2019-01-31 19:09 UTC (permalink / raw)
To: dri-devel
Cc: linux-doc, Maxime Ripard, Sean Paul, David Airlie, Sean Paul,
Sam Ravnborg
On Tue, Jan 29, 2019 at 02:26:29PM -0500, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> Drivers shouldn't be using these values, add a TODO so someone removes
> them.
>
> Changes in v2:
> - Add drm_display_mode.vrefresh removal (Ville)
> - Add Sam's R-b and bonus points
> Changes in v3:
> - Add hsync removal todo item (Daniel)
> - Change vrefresh wording to make removal less optional
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> Bonus-points-awarded-by: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
And applied to -misc-next.
Thanks for the reviews, all.
Sean
> ---
>
> This time with feeling.
>
> Documentation/gpu/todo.rst | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 38360ede12215..f67c84b92873c 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -262,6 +262,34 @@ As a reference, take a look at the conversions already completed in drm core.
>
> Contact: Sean Paul, respective driver maintainers
>
> +Convert direct mode.vrefresh accesses to use drm_mode_vrefresh()
> +----------------------------------------------------------------
> +
> +drm_display_mode.vrefresh isn't guaranteed to be populated. As such, using it
> +is risky and has been known to cause div-by-zero bugs. Fortunately, drm core
> +has helper which will use mode.vrefresh if it's !0 and will calculate it from
> +the timings when it's 0.
> +
> +Use simple search/replace, or (more fun) cocci to replace instances of direct
> +vrefresh access with a call to the helper. Check out
> +https://lists.freedesktop.org/archives/dri-devel/2019-January/205186.html for
> +inspiration.
> +
> +Once all instances of vrefresh have been converted, remove vrefresh from
> +drm_display_mode to avoid future use.
> +
> +Contact: Sean Paul
> +
> +Remove drm_display_mode.hsync
> +-----------------------------
> +
> +We have drm_mode_hsync() to calculate this from hsync_start/end, since drivers
> +shouldn't/don't use this, remove this member to avoid any temptations to use it
> +in the future. If there is any debug code using drm_display_mode.hsync, convert
> +it to use drm_mode_hsync() instead.
> +
> +Contact: Sean Paul
> +
> Core refactorings
> =================
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-01-31 19:09 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 16:15 [PATCH] drm/TODO: Add vrefresh replacement to the todo Sean Paul
2019-01-29 16:15 ` Sean Paul
2019-01-29 16:28 ` Sam Ravnborg
2019-01-29 16:28 ` Sam Ravnborg
2019-01-29 16:35 ` Ville Syrjälä
2019-01-29 16:35 ` Ville Syrjälä
2019-01-29 16:45 ` [PATCH v2] " Sean Paul
2019-01-29 16:45 ` Sean Paul
2019-01-29 17:24 ` Daniel Vetter
2019-01-29 17:24 ` Daniel Vetter
2019-01-29 19:26 ` [PATCH v3] drm/TODO: Add drm_display_mode.hsync/vrefresh removal Sean Paul
2019-01-29 19:26 ` Sean Paul
2019-01-31 19:09 ` Sean Paul
2019-01-31 19:09 ` Sean Paul
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.