Skip to content

Commit d7ecd05

Browse files
committed
drm/i915/bw: make struct intel_bw_state opaque
With all the code touching struct intel_bw_state moved inside intel_bw.c, we move the struct definition there too, and make the type opaque. to_intel_bw_state() needs to be turned into a proper function. All of this nicely reduces includes from intel_bw.h. Reviewed-by: Imre Deak <imre.deak@intel.com> Link: https://lore.kernel.org/r/743ba67e4e3c5dac4f5e58ab4d2357edea601d09.1750847509.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 2e58223 commit d7ecd05

2 files changed

Lines changed: 43 additions & 41 deletions

File tree

drivers/gpu/drm/i915/display/intel_bw.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,41 @@
2121
#include "intel_uncore.h"
2222
#include "skl_watermark.h"
2323

24+
struct intel_dbuf_bw {
25+
unsigned int max_bw[I915_MAX_DBUF_SLICES];
26+
u8 active_planes[I915_MAX_DBUF_SLICES];
27+
};
28+
29+
struct intel_bw_state {
30+
struct intel_global_state base;
31+
struct intel_dbuf_bw dbuf_bw[I915_MAX_PIPES];
32+
33+
/*
34+
* Contains a bit mask, used to determine, whether correspondent
35+
* pipe allows SAGV or not.
36+
*/
37+
u8 pipe_sagv_reject;
38+
39+
/* bitmask of active pipes */
40+
u8 active_pipes;
41+
42+
/*
43+
* From MTL onwards, to lock a QGV point, punit expects the peak BW of
44+
* the selected QGV point as the parameter in multiples of 100MB/s
45+
*/
46+
u16 qgv_point_peakbw;
47+
48+
/*
49+
* Current QGV points mask, which restricts
50+
* some particular SAGV states, not to confuse
51+
* with pipe_sagv_mask.
52+
*/
53+
u16 qgv_points_mask;
54+
55+
unsigned int data_rate[I915_MAX_PIPES];
56+
u8 num_active_planes[I915_MAX_PIPES];
57+
};
58+
2459
/* Parameters for Qclk Geyserville (QGV) */
2560
struct intel_qgv_point {
2661
u16 dclk, t_rp, t_rdpre, t_rc, t_ras, t_rcd;
@@ -872,6 +907,11 @@ static unsigned int intel_bw_data_rate(struct intel_display *display,
872907
return data_rate;
873908
}
874909

910+
struct intel_bw_state *to_intel_bw_state(struct intel_global_state *obj_state)
911+
{
912+
return container_of(obj_state, struct intel_bw_state, base);
913+
}
914+
875915
struct intel_bw_state *
876916
intel_atomic_get_old_bw_state(struct intel_atomic_state *state)
877917
{

drivers/gpu/drm/i915/display/intel_bw.h

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,14 @@
88

99
#include <drm/drm_atomic.h>
1010

11-
#include "intel_display_limits.h"
12-
#include "intel_display_power.h"
13-
#include "intel_global_state.h"
14-
1511
struct intel_atomic_state;
12+
struct intel_bw_state;
1613
struct intel_crtc;
1714
struct intel_crtc_state;
1815
struct intel_display;
16+
struct intel_global_state;
1917

20-
struct intel_dbuf_bw {
21-
unsigned int max_bw[I915_MAX_DBUF_SLICES];
22-
u8 active_planes[I915_MAX_DBUF_SLICES];
23-
};
24-
25-
struct intel_bw_state {
26-
struct intel_global_state base;
27-
struct intel_dbuf_bw dbuf_bw[I915_MAX_PIPES];
28-
29-
/*
30-
* Contains a bit mask, used to determine, whether correspondent
31-
* pipe allows SAGV or not.
32-
*/
33-
u8 pipe_sagv_reject;
34-
35-
/* bitmask of active pipes */
36-
u8 active_pipes;
37-
38-
/*
39-
* From MTL onwards, to lock a QGV point, punit expects the peak BW of
40-
* the selected QGV point as the parameter in multiples of 100MB/s
41-
*/
42-
u16 qgv_point_peakbw;
43-
44-
/*
45-
* Current QGV points mask, which restricts
46-
* some particular SAGV states, not to confuse
47-
* with pipe_sagv_mask.
48-
*/
49-
u16 qgv_points_mask;
50-
51-
unsigned int data_rate[I915_MAX_PIPES];
52-
u8 num_active_planes[I915_MAX_PIPES];
53-
};
54-
55-
#define to_intel_bw_state(global_state) \
56-
container_of_const((global_state), struct intel_bw_state, base)
18+
struct intel_bw_state *to_intel_bw_state(struct intel_global_state *obj_state);
5719

5820
struct intel_bw_state *
5921
intel_atomic_get_old_bw_state(struct intel_atomic_state *state);

0 commit comments

Comments
 (0)