mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-15 16:53:54 +08:00
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
This commit is contained in:
parent
839b480dd1
commit
58911c2407
@ -347,18 +347,6 @@ Contact: Sean Paul
|
||||
|
||||
Level: Starter
|
||||
|
||||
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
|
||||
|
||||
Level: Starter
|
||||
|
||||
connector register/unregister fixes
|
||||
-----------------------------------
|
||||
|
||||
|
@ -2380,6 +2380,14 @@ bad_std_timing(u8 a, u8 b)
|
||||
(a == 0x20 && b == 0x20);
|
||||
}
|
||||
|
||||
static int drm_mode_hsync(const struct drm_display_mode *mode)
|
||||
{
|
||||
if (mode->htotal <= 0)
|
||||
return 0;
|
||||
|
||||
return DIV_ROUND_CLOSEST(mode->clock, mode->htotal);
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_mode_std - convert standard mode info (width, height, refresh) into mode
|
||||
* @connector: connector of for the EDID block
|
||||
|
@ -747,32 +747,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
|
||||
|
@ -8891,7 +8891,6 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode,
|
||||
|
||||
mode->clock = pipe_config->hw.adjusted_mode.crtc_clock;
|
||||
|
||||
mode->hsync = drm_mode_hsync(mode);
|
||||
mode->vrefresh = drm_mode_vrefresh(mode);
|
||||
drm_mode_set_name(mode);
|
||||
}
|
||||
|
@ -390,16 +390,6 @@ struct drm_display_mode {
|
||||
*/
|
||||
int vrefresh;
|
||||
|
||||
/**
|
||||
* @hsync:
|
||||
*
|
||||
* Horizontal refresh rate, for debug output in human readable form. Not
|
||||
* used in a functional way.
|
||||
*
|
||||
* This value is in kHz.
|
||||
*/
|
||||
int hsync;
|
||||
|
||||
/**
|
||||
* @picture_aspect_ratio:
|
||||
*
|
||||
@ -493,7 +483,6 @@ int of_get_drm_display_mode(struct device_node *np,
|
||||
int index);
|
||||
|
||||
void drm_mode_set_name(struct drm_display_mode *mode);
|
||||
int drm_mode_hsync(const struct drm_display_mode *mode);
|
||||
int drm_mode_vrefresh(const struct drm_display_mode *mode);
|
||||
void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
|
||||
int *hdisplay, int *vdisplay);
|
||||
|
Loading…
Reference in New Issue
Block a user