diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-04-28 20:19:25 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-04-29 18:44:26 +0300 |
commit | 58911c240783e0d1e7d457832416eb3347b8abbb (patch) | |
tree | d215b50dcece45e65d1d165b59b03a448dfc1af6 /drivers/gpu/drm/drm_modes.c | |
parent | 839b480dd11144f258d0b1babf33cc7c604adeb4 (diff) | |
download | linux-58911c240783e0d1e7d457832416eb3347b8abbb.tar.gz linux-58911c240783e0d1e7d457832416eb3347b8abbb.tar.bz2 linux-58911c240783e0d1e7d457832416eb3347b8abbb.zip |
drm: Nuke mode->hsync
Let's just calculate the hsync rate on demand. No point in wasting
space storing it and risking the cached value getting out of sync
with reality.
v2: Move drm_mode_hsync() next to its only users
Drop the TODO
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> #v1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428171940.19552-2-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index d4d64518e11b..fec1c33b3045 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -748,32 +748,6 @@ void drm_mode_set_name(struct drm_display_mode *mode) EXPORT_SYMBOL(drm_mode_set_name); /** - * drm_mode_hsync - get the hsync of a mode - * @mode: mode - * - * Returns: - * @modes's hsync rate in kHz, rounded to the nearest integer. Calculates the - * value first if it is not yet set. - */ -int drm_mode_hsync(const struct drm_display_mode *mode) -{ - unsigned int calc_val; - - if (mode->hsync) - return mode->hsync; - - if (mode->htotal <= 0) - return 0; - - calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */ - calc_val += 500; /* round to 1000Hz */ - calc_val /= 1000; /* truncate to kHz */ - - return calc_val; -} -EXPORT_SYMBOL(drm_mode_hsync); - -/** * drm_mode_vrefresh - get the vrefresh of a mode * @mode: mode * |