]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Streamline the artihmetic
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 29 Apr 2020 18:54:57 +0000 (21:54 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 4 May 2020 15:44:53 +0000 (18:44 +0300)
commitaa8fd2589cc0ca2e0ab98c86c5e85a95d7db61cd
treee714351ecb889a7da3e52adcc6d6326e5638a8d2
parenta46ee0fcaa7af428b66e65d7f4910a8f8c9ab554
drm/i915: Streamline the artihmetic

All these ROUNDING_FACTORs and whatnot are making this thing hard to
read. Get rid of them. And let's massage some of the fractions to
give us less questionable intermediate results and perhaps less
divisions.

Also looks like a good helping of 64bit math stuff is needed to
avoid some of overflows present in the current code. There
might still be a few overflows, namely when calculating
link_clks_available/samples_room (would require a huge hblank
though), and potentially when calculating hblank_rise (not sure
how large link_clks_active can get).

It looks like we're still not calculating exactly what the spec says
since we truncate tu_data and tu_line early. But I'm too lazy to
figure out if we could avoid that.

v2: Fix typo in commit msg (Uma)
    Remove ROUNDING_FACTOR define (Uma)
    s/5*link_clk+5*cdclk/5*(link_clk+cdclk)/ (Chris)

Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429185457.26235-3-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
drivers/gpu/drm/i915/display/intel_audio.c