mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 11:55:49 +07:00
c457d9cf25
ICL has so many planes that it can easily exceed the maximum effective memory bandwidth of the system. We must therefore check that we don't exceed that limit. The algorithm is very magic number heavy and lacks sufficient explanation for now. We also have no sane way to query the memory clock and timings, so we must rely on a combination of raw readout from the memory controller and hardcoded assumptions. The memory controller values obviously change as the system jumps between the different SAGV points, so we try to stabilize it first by disabling SAGV for the duration of the readout. The utilized bandwidth is tracked via a device wide atomic private object. That is actually not robust because we can't afford to enforce strict global ordering between the pipes. Thus I think I'll need to change this to simply chop up the available bandwidth between all the active pipes. Each pipe can then do whatever it wants as long as it doesn't exceed its budget. That scheme will also require that we assume that any number of planes could be active at any time. TODO: make it robust and deal with all the open questions v2: Sleep longer after disabling SAGV v3: Poll for the dclk to get raised (seen it take 250ms!) If the system has 2133MT/s memory then we pointlessly wait one full second :( v4: Use the new pcode interface to get the qgv points rather that using hardcoded numbers v5: Move the pcode stuff into intel_bw.c (Matt) s/intel_sagv_info/intel_qgv_info/ Do the NV12/P010 as per spec for now (Matt) s/IS_ICELAKE/IS_GEN11/ v6: Ignore bandwidth limits if the pcode query fails Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Acked-by: Clint Taylor <Clinton.A.Taylor@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190524153614.32410-1-ville.syrjala@linux.intel.com
43 lines
1.6 KiB
C
43 lines
1.6 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __INTEL_ATOMIC_PLANE_H__
|
|
#define __INTEL_ATOMIC_PLANE_H__
|
|
|
|
struct drm_plane;
|
|
struct intel_atomic_state;
|
|
struct intel_crtc;
|
|
struct intel_crtc_state;
|
|
struct intel_plane;
|
|
struct intel_plane_state;
|
|
|
|
extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
|
|
|
|
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
|
|
const struct intel_plane_state *plane_state);
|
|
void intel_update_plane(struct intel_plane *plane,
|
|
const struct intel_crtc_state *crtc_state,
|
|
const struct intel_plane_state *plane_state);
|
|
void intel_update_slave(struct intel_plane *plane,
|
|
const struct intel_crtc_state *crtc_state,
|
|
const struct intel_plane_state *plane_state);
|
|
void intel_disable_plane(struct intel_plane *plane,
|
|
const struct intel_crtc_state *crtc_state);
|
|
struct intel_plane *intel_plane_alloc(void);
|
|
void intel_plane_free(struct intel_plane *plane);
|
|
struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
|
|
void intel_plane_destroy_state(struct drm_plane *plane,
|
|
struct drm_plane_state *state);
|
|
void skl_update_planes_on_crtc(struct intel_atomic_state *state,
|
|
struct intel_crtc *crtc);
|
|
void i9xx_update_planes_on_crtc(struct intel_atomic_state *state,
|
|
struct intel_crtc *crtc);
|
|
int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
|
|
struct intel_crtc_state *crtc_state,
|
|
const struct intel_plane_state *old_plane_state,
|
|
struct intel_plane_state *intel_state);
|
|
|
|
#endif /* __INTEL_ATOMIC_PLANE_H__ */
|