linux_dsm_epyc7002/drivers/gpu/drm
Stanislav Lisovskiy 7a9ccdd1e0 drm/i915: Use intel_plane_data_rate for min_cdclk calculation
There seems to be a bit of confusing redundancy in a way, how
plane data rate/min cdclk are calculated.
In fact both min cdclk, pixel rate and plane data rate are all
part of the same formula as per BSpec.

However currently we have intel_plane_data_rate, which is used
to calculate plane data rate and which is also used in bandwidth
calculations. However for calculating min_cdclk we have another
piece of code, doing almost same calculation, but a bit differently
and in a different place. However as both are actually part of same
formula, probably would be wise to use plane data rate calculations
as a basis anyway, thus avoiding code duplication and possible bugs
related to this.

Another thing is that I've noticed that during min_cdclk calculations
we account for plane scaling, while for plane data rate, we don't.
crtc->pixel_rate seems to account only for pipe ratio, however it is
clearly stated in BSpec that plane data rate also need to account
plane ratio as well.

So what this commit does is:
- Adds a plane ratio calculation to intel_plane_data_rate
- Removes redundant calculations from skl_plane_min_cdclk which is
  used for gen9+ and now uses intel_plane_data_rate as a basis from
  there as well.

v2: - Don't use 64 division if not needed(Ville Syrjälä)
    - Now use intel_plane_pixel_rate as a basis for calculations both
      at intel_plane_data_rate and skl_plane_min_cdclk(Ville Syrjälä)

v3: - Again fix the division macro
    - Fix plane_pixel_rate to pixel_rate at intel_plane_pixel_rate
      callsites

v4: - Renamed skl_plane_ratio function back(Ville Syrjälä)

v5: - Don't precalculate plane pixel rate for invisible plane,
      check for visibility first, as in invisible case it will
      have dst_w and dst_h equal to zero, causing divide error.

v6: - Removed useless warn in intel_plane_pixel_rate(Ville Syrjälä)
    - Fixed alignment in intel_plane_data_rate(Ville Syrjälä)
    - Changed pixel_rate type to be unsigned int in
      skl_plane_min_cdclk(Ville Syrjälä)

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227150935.2107-1-stanislav.lisovskiy@intel.com
2020-03-02 19:27:25 +02:00
..
amd drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
arc drm/arc: Remove sending of vblank event 2020-01-30 08:57:22 +01:00
arm
armada
aspeed
ast drm/vram: Add helpers to validate a display mode's memory requirements 2020-02-06 10:32:54 +01:00
atmel-hlcdc
bochs drm/bochs: Clear struct drm_connector_funcs.dpms 2020-02-10 09:23:50 +01:00
bridge drm/bridge: Patch atomic hooks to take a drm_bridge_state 2020-01-31 16:00:24 +01:00
cirrus drm/cirrus: Remove sending of vblank event 2020-01-30 09:00:45 +01:00
etnaviv drm pull for 5.6-rc1 2020-01-30 08:04:01 -08:00
exynos
fsl-dcu
gma500 drm pull for 5.6-rc1 2020-01-30 08:04:01 -08:00
hisilicon drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
i2c
i810
i915 drm/i915: Use intel_plane_data_rate for min_cdclk calculation 2020-03-02 19:27:25 +02:00
imx drm/imx: pd: Use bus format/flags provided by the bridge when available 2020-01-31 16:40:12 +01:00
ingenic
lib
lima drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
mcde
mediatek
meson
mga
mgag200
msm drm-misc-next fixes for v5.6: 2020-02-14 12:57:57 +10:00
mxsfb
nouveau drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
omapdrm
panel drm/panel: simple: Fix the lt089ac29000 bus_format 2020-01-31 17:48:16 +01:00
panfrost drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
pl111
qxl drm/qxl: Remove sending of vblank event 2020-01-30 09:00:45 +01:00
r128
radeon drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
rcar-du drm/bridge: Patch atomic hooks to take a drm_bridge_state 2020-01-31 16:00:24 +01:00
rockchip drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
savage
scheduler drm/amdgpu: fix doc by clarifying sched_list definition 2020-01-27 16:46:44 -05:00
selftests
shmobile
sis
sti drm pull for 5.6-rc1 2020-01-30 08:04:01 -08:00
stm drm/stm: dsi: stm mipi dsi doesn't print error on probe deferral 2020-02-04 11:47:43 +01:00
sun4i Fixes for v5.6: 2020-02-14 12:53:00 +10:00
tdfx
tegra drm/tegra: Fixes for v5.6-rc1 2020-02-07 12:22:30 +10:00
tidss drm/tidss: New driver for TI Keystone platform Display SubSystem 2020-01-27 19:27:30 +02:00
tilcdc drm pull for 5.6-rc1 2020-01-30 08:04:01 -08:00
tiny drm/tiny/st7735r: No need to set ->owner for spi_register_driver() 2020-02-10 02:54:47 +01:00
ttm drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
tve200
udl drm/udl: Clear struct drm_connector_funcs.dpms 2020-02-10 09:24:09 +01:00
v3d
vboxvideo drm/vboxvideo: Implement struct drm_mode_config_funcs.mode_valid 2020-02-06 10:34:06 +01:00
vc4 drm/vc4: plane_state->fb iff plane_state->crtc 2020-01-28 15:42:43 +01:00
vgem drm/vgem: Close use-after-free race in vgem_gem_create 2020-02-06 19:04:41 +01:00
via Merge branch 'akpm' (patches from Andrew) 2020-01-31 12:16:36 -08:00
virtio drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
vkms drm/vkms: plane_state->fb iff plane_state->crtc 2020-01-28 15:43:32 +01:00
vmwgfx drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
xen drm/xen: Explicitly disable automatic sending of vblank event 2020-01-30 09:00:51 +01:00
zte drm/zte: plane_state->fb iff plane_state->crtc 2020-01-28 15:43:58 +01:00
drm_agpsupport.c
drm_atomic_helper.c drm/bridge: Add the necessary bits to support bus format negotiation 2020-01-31 16:39:53 +01:00
drm_atomic_state_helper.c drm/bridge: Add a drm_bridge_state object 2020-01-31 16:00:21 +01:00
drm_atomic_uapi.c
drm_atomic.c drm/bridge: Add a drm_bridge_state object 2020-01-31 16:00:21 +01:00
drm_auth.c drm/auth: Drop master_create/destroy hooks 2020-01-29 09:14:11 +01:00
drm_blend.c
drm_bridge.c drm/bridge: Add the necessary bits to support bus format negotiation 2020-01-31 16:39:53 +01:00
drm_bufs.c drm: Remove the dma_alloc_coherent wrapper for internal usage 2020-02-04 23:57:26 +00:00
drm_cache.c
drm_client_modeset.c
drm_client.c
drm_color_mgmt.c
drm_connector.c
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h
drm_crtc.c
drm_damage_helper.c
drm_debugfs_crc.c drm/crc: Actually allow to change the crc source 2020-01-28 16:49:22 +01:00
drm_debugfs.c drm/debugfs: also take per device driver features into account 2020-01-25 15:49:11 +02:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm-misc-next for 5.7: 2020-02-21 05:44:40 +10:00
drm_drv.c
drm_dsc.c
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm/edid: fix building error 2020-02-06 22:01:40 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c
drm_file.c drm: Avoid drm_global_mutex for simple inc/dec of dev->open_count 2020-01-24 17:41:34 +00:00
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm/vram: Add helpers to validate a display mode's memory requirements 2020-02-06 10:32:54 +01:00
drm_gem.c
drm_hashtab.c
drm_hdcp.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy_misc.c
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Remove sending of vblank event 2020-01-30 09:00:45 +01:00
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel_orientation_quirks.c
drm_panel.c
drm_pci.c drm: Remove the dma_alloc_coherent wrapper for internal usage 2020-02-04 23:57:26 +00:00
drm_plane_helper.c
drm_plane.c
drm_prime.c
drm_print.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vblank.c drm: Initialize struct drm_crtc_state.no_vblank from device settings 2020-01-30 08:57:12 +01:00
drm_vm.c drm: Remove the dma_alloc_coherent wrapper for internal usage 2020-02-04 23:57:26 +00:00
drm_vma_manager.c
drm_vram_helper_common.c
drm_writeback.c
Kconfig drm/tidss: New driver for TI Keystone platform Display SubSystem 2020-01-27 19:27:30 +02:00
Makefile drm/tidss: New driver for TI Keystone platform Display SubSystem 2020-01-27 19:27:30 +02:00