Skip to content

Commit ac7f11c

Browse files
author
Ander Conselvan de Oliveira
committed
drm/i915: Move shared dpll struct definitions to separate header file
Move the declarations related to shared dplls from i915_drv.h to their own header file. The code that became the shared dpll infrastructre was first introcude in commit ee7b9f9 ("drm/i915: manage PCH PLLs separately from pipes"), hence the 2012-2016 copyright years in the new header file. Signed-off-by: Ander Conselvan de Oliveira <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/1457451987-17466-6-git-send-email-ander.conselvan.de.oliveira@intel.com
1 parent 8106ddb commit ac7f11c

File tree

2 files changed

+107
-75
lines changed

2 files changed

+107
-75
lines changed

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include <linux/kref.h>
5454
#include <linux/pm_qos.h>
5555
#include "intel_guc.h"
56+
#include "intel_dpll_mgr.h"
5657

5758
/* General customization:
5859
*/
@@ -340,81 +341,6 @@ struct drm_i915_file_private {
340341
unsigned int bsd_ring;
341342
};
342343

343-
enum intel_dpll_id {
344-
DPLL_ID_PRIVATE = -1, /* non-shared dpll in use */
345-
/* real shared dpll ids must be >= 0 */
346-
DPLL_ID_PCH_PLL_A = 0,
347-
DPLL_ID_PCH_PLL_B = 1,
348-
/* hsw/bdw */
349-
DPLL_ID_WRPLL1 = 0,
350-
DPLL_ID_WRPLL2 = 1,
351-
DPLL_ID_SPLL = 2,
352-
353-
/* skl */
354-
DPLL_ID_SKL_DPLL1 = 0,
355-
DPLL_ID_SKL_DPLL2 = 1,
356-
DPLL_ID_SKL_DPLL3 = 2,
357-
};
358-
#define I915_NUM_PLLS 3
359-
360-
struct intel_dpll_hw_state {
361-
/* i9xx, pch plls */
362-
uint32_t dpll;
363-
uint32_t dpll_md;
364-
uint32_t fp0;
365-
uint32_t fp1;
366-
367-
/* hsw, bdw */
368-
uint32_t wrpll;
369-
uint32_t spll;
370-
371-
/* skl */
372-
/*
373-
* DPLL_CTRL1 has 6 bits for each each this DPLL. We store those in
374-
* lower part of ctrl1 and they get shifted into position when writing
375-
* the register. This allows us to easily compare the state to share
376-
* the DPLL.
377-
*/
378-
uint32_t ctrl1;
379-
/* HDMI only, 0 when used for DP */
380-
uint32_t cfgcr1, cfgcr2;
381-
382-
/* bxt */
383-
uint32_t ebb0, ebb4, pll0, pll1, pll2, pll3, pll6, pll8, pll9, pll10,
384-
pcsdw12;
385-
};
386-
387-
struct intel_shared_dpll_config {
388-
unsigned crtc_mask; /* mask of CRTCs sharing this PLL */
389-
struct intel_dpll_hw_state hw_state;
390-
};
391-
392-
struct intel_shared_dpll {
393-
struct intel_shared_dpll_config config;
394-
395-
int active; /* count of number of active CRTCs (i.e. DPMS on) */
396-
bool on; /* is the PLL actually active? Disabled during modeset */
397-
const char *name;
398-
/* should match the index in the dev_priv->shared_dplls array */
399-
enum intel_dpll_id id;
400-
/* The mode_set hook is optional and should be used together with the
401-
* intel_prepare_shared_dpll function. */
402-
void (*mode_set)(struct drm_i915_private *dev_priv,
403-
struct intel_shared_dpll *pll);
404-
void (*enable)(struct drm_i915_private *dev_priv,
405-
struct intel_shared_dpll *pll);
406-
void (*disable)(struct drm_i915_private *dev_priv,
407-
struct intel_shared_dpll *pll);
408-
bool (*get_hw_state)(struct drm_i915_private *dev_priv,
409-
struct intel_shared_dpll *pll,
410-
struct intel_dpll_hw_state *hw_state);
411-
};
412-
413-
#define SKL_DPLL0 0
414-
#define SKL_DPLL1 1
415-
#define SKL_DPLL2 2
416-
#define SKL_DPLL3 3
417-
418344
/* Used by dp and fdi links */
419345
struct intel_link_m_n {
420346
uint32_t tu;
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* Copyright © 2012-2016 Intel Corporation
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice (including the next
12+
* paragraph) shall be included in all copies or substantial portions of the
13+
* Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21+
* IN THE SOFTWARE.
22+
*
23+
*/
24+
25+
#ifndef _INTEL_DPLL_MGR_H_
26+
#define _INTEL_DPLL_MGR_H_
27+
28+
struct drm_i915_private;
29+
30+
enum intel_dpll_id {
31+
DPLL_ID_PRIVATE = -1, /* non-shared dpll in use */
32+
/* real shared dpll ids must be >= 0 */
33+
DPLL_ID_PCH_PLL_A = 0,
34+
DPLL_ID_PCH_PLL_B = 1,
35+
/* hsw/bdw */
36+
DPLL_ID_WRPLL1 = 0,
37+
DPLL_ID_WRPLL2 = 1,
38+
DPLL_ID_SPLL = 2,
39+
40+
/* skl */
41+
DPLL_ID_SKL_DPLL1 = 0,
42+
DPLL_ID_SKL_DPLL2 = 1,
43+
DPLL_ID_SKL_DPLL3 = 2,
44+
};
45+
#define I915_NUM_PLLS 3
46+
47+
struct intel_dpll_hw_state {
48+
/* i9xx, pch plls */
49+
uint32_t dpll;
50+
uint32_t dpll_md;
51+
uint32_t fp0;
52+
uint32_t fp1;
53+
54+
/* hsw, bdw */
55+
uint32_t wrpll;
56+
uint32_t spll;
57+
58+
/* skl */
59+
/*
60+
* DPLL_CTRL1 has 6 bits for each each this DPLL. We store those in
61+
* lower part of ctrl1 and they get shifted into position when writing
62+
* the register. This allows us to easily compare the state to share
63+
* the DPLL.
64+
*/
65+
uint32_t ctrl1;
66+
/* HDMI only, 0 when used for DP */
67+
uint32_t cfgcr1, cfgcr2;
68+
69+
/* bxt */
70+
uint32_t ebb0, ebb4, pll0, pll1, pll2, pll3, pll6, pll8, pll9, pll10,
71+
pcsdw12;
72+
};
73+
74+
struct intel_shared_dpll_config {
75+
unsigned crtc_mask; /* mask of CRTCs sharing this PLL */
76+
struct intel_dpll_hw_state hw_state;
77+
};
78+
79+
struct intel_shared_dpll {
80+
struct intel_shared_dpll_config config;
81+
82+
int active; /* count of number of active CRTCs (i.e. DPMS on) */
83+
bool on; /* is the PLL actually active? Disabled during modeset */
84+
const char *name;
85+
/* should match the index in the dev_priv->shared_dplls array */
86+
enum intel_dpll_id id;
87+
/* The mode_set hook is optional and should be used together with the
88+
* intel_prepare_shared_dpll function. */
89+
void (*mode_set)(struct drm_i915_private *dev_priv,
90+
struct intel_shared_dpll *pll);
91+
void (*enable)(struct drm_i915_private *dev_priv,
92+
struct intel_shared_dpll *pll);
93+
void (*disable)(struct drm_i915_private *dev_priv,
94+
struct intel_shared_dpll *pll);
95+
bool (*get_hw_state)(struct drm_i915_private *dev_priv,
96+
struct intel_shared_dpll *pll,
97+
struct intel_dpll_hw_state *hw_state);
98+
};
99+
100+
#define SKL_DPLL0 0
101+
#define SKL_DPLL1 1
102+
#define SKL_DPLL2 2
103+
#define SKL_DPLL3 3
104+
105+
106+
#endif /* _INTEL_DPLL_MGR_H_ */

0 commit comments

Comments
 (0)