Skip to content

Commit 49cd97a

Browse files
committed
drm/i915: Start moving the cdclk stuff into a distinct state structure
Introduce intel_cdclk state which for now will track the cdclk frequency, the vco frequency and the reference frequency (not sure we want the last one, but I put it there anyway). We'll also make the .get_cdclk() function fill out this state structure rather than just returning the current cdclk frequency. One immediate benefit is that calling .get_cdclk() will no longer clobber state stored under dev_priv unless ex[plicitly told to do so. Previously it clobbered the vco and reference clocks stored there on some platforms. We'll expand the use of this structure to actually precomputing the state and whatnot later. v2: Constify intel_cdclk_state_compare() v3: Document intel_cdclk_state_compare() v4: Deal with i945gm_get_cdclk() Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Ander Conselvan de Oliveira <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8f0cfa4 commit 49cd97a

File tree

10 files changed

+258
-176
lines changed

10 files changed

+258
-176
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ static int i915_frequency_info(struct seq_file *m, void *unused)
12811281
seq_puts(m, "no P-state info available\n");
12821282
}
12831283

1284-
seq_printf(m, "Current CD clock frequency: %d kHz\n", dev_priv->cdclk_freq);
1284+
seq_printf(m, "Current CD clock frequency: %d kHz\n", dev_priv->cdclk.hw.cdclk);
12851285
seq_printf(m, "Max CD clock frequency: %d kHz\n", dev_priv->max_cdclk_freq);
12861286
seq_printf(m, "Max pixel clock frequency: %d kHz\n", dev_priv->max_dotclk_freq);
12871287

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,11 @@ struct intel_initial_plane_config;
600600
struct intel_crtc;
601601
struct intel_limit;
602602
struct dpll;
603+
struct intel_cdclk_state;
603604

604605
struct drm_i915_display_funcs {
605-
int (*get_cdclk)(struct drm_i915_private *dev_priv);
606+
void (*get_cdclk)(struct drm_i915_private *dev_priv,
607+
struct intel_cdclk_state *cdclk_state);
606608
int (*get_fifo_size)(struct drm_i915_private *dev_priv, int plane);
607609
int (*compute_pipe_wm)(struct intel_crtc_state *cstate);
608610
int (*compute_intermediate_wm)(struct drm_device *dev,
@@ -2060,6 +2062,10 @@ struct i915_oa_ops {
20602062
bool (*oa_buffer_is_empty)(struct drm_i915_private *dev_priv);
20612063
};
20622064

2065+
struct intel_cdclk_state {
2066+
unsigned int cdclk, vco, ref;
2067+
};
2068+
20632069
struct drm_i915_private {
20642070
struct drm_device drm;
20652071

@@ -2164,7 +2170,7 @@ struct drm_i915_private {
21642170

21652171
unsigned int fsb_freq, mem_freq, is_ddr3;
21662172
unsigned int skl_preferred_vco_freq;
2167-
unsigned int cdclk_freq, max_cdclk_freq;
2173+
unsigned int max_cdclk_freq;
21682174

21692175
/*
21702176
* For reading holding any crtc lock is sufficient,
@@ -2178,8 +2184,8 @@ struct drm_i915_private {
21782184
unsigned int czclk_freq;
21792185

21802186
struct {
2181-
unsigned int vco, ref;
2182-
} cdclk_pll;
2187+
struct intel_cdclk_state hw;
2188+
} cdclk;
21832189

21842190
/**
21852191
* wq - Driver workqueue for GEM.

drivers/gpu/drm/i915/intel_audio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ static int i915_audio_component_get_cdclk_freq(struct device *kdev)
734734
if (WARN_ON_ONCE(!HAS_DDI(dev_priv)))
735735
return -ENODEV;
736736

737-
return dev_priv->cdclk_freq;
737+
return dev_priv->cdclk.hw.cdclk;
738738
}
739739

740740
/*

0 commit comments

Comments
 (0)