Subversion Repositories Kolibri OS

Rev

Rev 6937 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6937 Rev 7144
Line 32... Line 32...
32
 
32
 
33
#include 
33
#include 
Line 34... Line 34...
34
#include 
34
#include 
-
 
35
 
35
 
36
#include 
36
#include 
37
#include "i915_params.h"
37
#include "i915_reg.h"
38
#include "i915_reg.h"
38
#include "intel_bios.h"
39
#include "intel_bios.h"
39
#include "intel_ringbuffer.h"
40
#include "intel_ringbuffer.h"
40
#include "intel_lrc.h"
41
#include "intel_lrc.h"
41
#include "i915_gem_gtt.h"
42
#include "i915_gem_gtt.h"
42
#include "i915_gem_render_state.h"
43
#include "i915_gem_render_state.h"
43
#include 
44
#include 
44
#include 
45
#include 
45
#include 
46
#include 
46
#include 
47
#include 
47
#include  /* for struct drm_dma_handle */
48
#include  /* for struct drm_dma_handle */
48
#include 
49
#include 
-
 
50
#include 
49
#include 
51
#include 
50
#include 
52
#include 
Line 51... Line -...
51
#include 
-
 
52
#include "intel_guc.h"
-
 
53
 
53
#include 
54
#include 
54
#include "intel_guc.h"
Line 55... Line 55...
55
 
55
 
56
/* General customization:
56
/* General customization:
57
 */
57
 */
Line 58... Line 58...
58
 
58
 
59
#define DRIVER_NAME		"i915"
59
#define DRIVER_NAME		"i915"
60
#define DRIVER_DESC		"Intel Graphics"
60
#define DRIVER_DESC		"Intel Graphics"
61
#define DRIVER_DATE		"20151218"
61
#define DRIVER_DATE		"20160229"
62
 
62
 
63
#undef WARN_ON
63
#undef WARN_ON
64
/* Many gcc seem to no see through this and fall over :( */
64
/* Many gcc seem to no see through this and fall over :( */
65
#if 0
65
#if 0
66
#define WARN_ON(x) ({ \
66
#define WARN_ON(x) ({ \
67
	bool __i915_warn_cond = (x); \
67
	bool __i915_warn_cond = (x); \
68
	if (__builtin_constant_p(__i915_warn_cond)) \
68
	if (__builtin_constant_p(__i915_warn_cond)) \
Line 69... Line 69...
69
		BUILD_BUG_ON(__i915_warn_cond); \
69
		BUILD_BUG_ON(__i915_warn_cond); \
70
	WARN(__i915_warn_cond, "WARN_ON(" #x ")"); })
70
	WARN(__i915_warn_cond, "WARN_ON(" #x ")"); })
Line 71... Line 71...
71
#else
71
#else
72
#define WARN_ON(x) WARN((x), "WARN_ON(%s)", #x )
72
#define WARN_ON(x) WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
Line 73... Line 73...
73
#endif
73
#endif
Line 85... Line 85...
85
 * enable distros and users to tailor their preferred amount of i915 abrt
85
 * enable distros and users to tailor their preferred amount of i915 abrt
86
 * spam.
86
 * spam.
87
 */
87
 */
88
#define I915_STATE_WARN(condition, format...) ({			\
88
#define I915_STATE_WARN(condition, format...) ({			\
89
	int __ret_warn_on = !!(condition);				\
89
	int __ret_warn_on = !!(condition);				\
90
	if (unlikely(__ret_warn_on)) {					\
90
	if (unlikely(__ret_warn_on))					\
91
		if (i915.verbose_state_checks)				\
91
		if (!WARN(i915.verbose_state_checks, format))		\
92
			WARN(1, format);				\
-
 
93
		else 							\
-
 
94
			DRM_ERROR(format);				\
92
			DRM_ERROR(format);				\
95
	}								\
-
 
96
	unlikely(__ret_warn_on);					\
93
	unlikely(__ret_warn_on);					\
97
})
94
})
Line 98... Line 95...
98
 
95
 
99
#define I915_STATE_WARN_ON(condition) ({				\
-
 
100
	int __ret_warn_on = !!(condition);				\
-
 
101
	if (unlikely(__ret_warn_on)) {					\
-
 
102
		if (i915.verbose_state_checks)				\
96
#define I915_STATE_WARN_ON(x)						\
103
			WARN(1, "WARN_ON(" #condition ")\n");		\
-
 
104
		else 							\
-
 
105
			DRM_ERROR("WARN_ON(" #condition ")\n");		\
-
 
106
	}								\
-
 
107
	unlikely(__ret_warn_on);					\
-
 
Line 108... Line 97...
108
})
97
	I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
109
 
98
 
110
static inline const char *yesno(bool v)
99
static inline const char *yesno(bool v)
111
{
100
{
Line -... Line 101...
-
 
101
	return v ? "yes" : "no";
-
 
102
}
-
 
103
 
-
 
104
static inline const char *onoff(bool v)
-
 
105
{
112
	return v ? "yes" : "no";
106
	return v ? "on" : "off";
113
}
107
}
114
 
108
 
115
enum pipe {
109
enum pipe {
116
	INVALID_PIPE = -1,
110
	INVALID_PIPE = -1,
Line 264... Line 258...
264
	 I915_GEM_DOMAIN_INSTRUCTION | \
258
	 I915_GEM_DOMAIN_INSTRUCTION | \
265
	 I915_GEM_DOMAIN_VERTEX)
259
	 I915_GEM_DOMAIN_VERTEX)
Line 266... Line 260...
266
 
260
 
267
#define for_each_pipe(__dev_priv, __p) \
261
#define for_each_pipe(__dev_priv, __p) \
-
 
262
	for ((__p) = 0; (__p) < INTEL_INFO(__dev_priv)->num_pipes; (__p)++)
-
 
263
#define for_each_pipe_masked(__dev_priv, __p, __mask) \
-
 
264
	for ((__p) = 0; (__p) < INTEL_INFO(__dev_priv)->num_pipes; (__p)++) \
268
	for ((__p) = 0; (__p) < INTEL_INFO(__dev_priv)->num_pipes; (__p)++)
265
		for_each_if ((__mask) & (1 << (__p)))
269
#define for_each_plane(__dev_priv, __pipe, __p)				\
266
#define for_each_plane(__dev_priv, __pipe, __p)				\
270
	for ((__p) = 0;							\
267
	for ((__p) = 0;							\
271
	     (__p) < INTEL_INFO(__dev_priv)->num_sprites[(__pipe)] + 1;	\
268
	     (__p) < INTEL_INFO(__dev_priv)->num_sprites[(__pipe)] + 1;	\
272
	     (__p)++)
269
	     (__p)++)
Line 337... Line 334...
337
	struct intel_rps_client {
334
	struct intel_rps_client {
338
		struct list_head link;
335
		struct list_head link;
339
		unsigned boosts;
336
		unsigned boosts;
340
	} rps;
337
	} rps;
Line 341... Line 338...
341
 
338
 
342
	struct intel_engine_cs *bsd_ring;
339
	unsigned int bsd_ring;
Line 343... Line 340...
343
};
340
};
344
 
341
 
345
enum intel_dpll_id {
342
enum intel_dpll_id {
Line 631... Line 628...
631
			  int target, int refclk,
628
			  int target, int refclk,
632
			  struct dpll *match_clock,
629
			  struct dpll *match_clock,
633
			  struct dpll *best_clock);
630
			  struct dpll *best_clock);
634
	int (*compute_pipe_wm)(struct intel_crtc *crtc,
631
	int (*compute_pipe_wm)(struct intel_crtc *crtc,
635
			       struct drm_atomic_state *state);
632
			       struct drm_atomic_state *state);
-
 
633
	void (*program_watermarks)(struct intel_crtc_state *cstate);
636
	void (*update_wm)(struct drm_crtc *crtc);
634
	void (*update_wm)(struct drm_crtc *crtc);
637
	int (*modeset_calc_cdclk)(struct drm_atomic_state *state);
635
	int (*modeset_calc_cdclk)(struct drm_atomic_state *state);
638
	void (*modeset_commit_cdclk)(struct drm_atomic_state *state);
636
	void (*modeset_commit_cdclk)(struct drm_atomic_state *state);
639
	/* Returns the active state of the crtc, and if the crtc is active,
637
	/* Returns the active state of the crtc, and if the crtc is active,
640
	 * fills out the pipe-config with the hw state. */
638
	 * fills out the pipe-config with the hw state. */
Line 655... Line 653...
655
	int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
653
	int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
656
			  struct drm_framebuffer *fb,
654
			  struct drm_framebuffer *fb,
657
			  struct drm_i915_gem_object *obj,
655
			  struct drm_i915_gem_object *obj,
658
			  struct drm_i915_gem_request *req,
656
			  struct drm_i915_gem_request *req,
659
			  uint32_t flags);
657
			  uint32_t flags);
660
	void (*update_primary_plane)(struct drm_crtc *crtc,
-
 
661
				     struct drm_framebuffer *fb,
-
 
662
				     int x, int y);
-
 
663
	void (*hpd_irq_setup)(struct drm_device *dev);
658
	void (*hpd_irq_setup)(struct drm_device *dev);
664
	/* clock updates for mode set */
659
	/* clock updates for mode set */
665
	/* cursor updates */
660
	/* cursor updates */
666
	/* render clock increase/decrease */
661
	/* render clock increase/decrease */
667
	/* display clock increase/decrease */
662
	/* display clock increase/decrease */
Line 724... Line 719...
724
		u32 val_clear;
719
		u32 val_clear;
725
		i915_reg_t reg_ack;
720
		i915_reg_t reg_ack;
726
		i915_reg_t reg_post;
721
		i915_reg_t reg_post;
727
		u32 val_reset;
722
		u32 val_reset;
728
	} fw_domain[FW_DOMAIN_ID_COUNT];
723
	} fw_domain[FW_DOMAIN_ID_COUNT];
-
 
724
 
-
 
725
	int unclaimed_mmio_check;
729
};
726
};
Line 730... Line 727...
730
 
727
 
731
/* Iterate over initialised fw domains */
728
/* Iterate over initialised fw domains */
732
#define for_each_fw_domain_mask(domain__, mask__, dev_priv__, i__) \
729
#define for_each_fw_domain_mask(domain__, mask__, dev_priv__, i__) \
Line 888... Line 885...
888
	/* Execlists */
885
	/* Execlists */
889
	struct {
886
	struct {
890
		struct drm_i915_gem_object *state;
887
		struct drm_i915_gem_object *state;
891
		struct intel_ringbuffer *ringbuf;
888
		struct intel_ringbuffer *ringbuf;
892
		int pin_count;
889
		int pin_count;
-
 
890
		struct i915_vma *lrc_vma;
-
 
891
		u64 lrc_desc;
-
 
892
		uint32_t *lrc_reg_state;
893
	} engine[I915_NUM_RINGS];
893
	} engine[I915_NUM_RINGS];
Line 894... Line 894...
894
 
894
 
895
	struct list_head link;
895
	struct list_head link;
Line 901... Line 901...
901
	ORIGIN_CS,
901
	ORIGIN_CS,
902
	ORIGIN_FLIP,
902
	ORIGIN_FLIP,
903
	ORIGIN_DIRTYFB,
903
	ORIGIN_DIRTYFB,
904
};
904
};
Line 905... Line 905...
905
 
905
 
906
struct i915_fbc {
906
struct intel_fbc {
907
	/* This is always the inner lock when overlapping with struct_mutex and
907
	/* This is always the inner lock when overlapping with struct_mutex and
908
	 * it's the outer lock when overlapping with stolen_lock. */
908
	 * it's the outer lock when overlapping with stolen_lock. */
909
	struct mutex lock;
909
	struct mutex lock;
910
	unsigned threshold;
-
 
911
	unsigned int fb_id;
910
	unsigned threshold;
912
	unsigned int possible_framebuffer_bits;
911
	unsigned int possible_framebuffer_bits;
-
 
912
	unsigned int busy_bits;
913
	unsigned int busy_bits;
913
	unsigned int visible_pipes_mask;
914
	struct intel_crtc *crtc;
-
 
Line 915... Line 914...
915
	int y;
914
	struct intel_crtc *crtc;
916
 
915
 
Line 917... Line 916...
917
	struct drm_mm_node compressed_fb;
916
	struct drm_mm_node compressed_fb;
Line 918... Line 917...
918
	struct drm_mm_node *compressed_llb;
917
	struct drm_mm_node *compressed_llb;
919
 
918
 
Line -... Line 919...
-
 
919
	bool false_color;
-
 
920
 
-
 
921
	bool enabled;
-
 
922
	bool active;
-
 
923
 
-
 
924
	struct intel_fbc_state_cache {
-
 
925
		struct {
-
 
926
			unsigned int mode_flags;
-
 
927
			uint32_t hsw_bdw_pixel_rate;
-
 
928
		} crtc;
-
 
929
 
-
 
930
		struct {
-
 
931
			unsigned int rotation;
-
 
932
			int src_w;
-
 
933
			int src_h;
-
 
934
			bool visible;
-
 
935
		} plane;
-
 
936
 
-
 
937
		struct {
-
 
938
			u64 ilk_ggtt_offset;
-
 
939
			uint32_t pixel_format;
-
 
940
			unsigned int stride;
-
 
941
			int fence_reg;
-
 
942
			unsigned int tiling_mode;
-
 
943
		} fb;
-
 
944
	} state_cache;
-
 
945
 
-
 
946
	struct intel_fbc_reg_params {
-
 
947
		struct {
-
 
948
			enum pipe pipe;
-
 
949
			enum plane plane;
-
 
950
			unsigned int fence_y_offset;
-
 
951
		} crtc;
-
 
952
 
-
 
953
		struct {
-
 
954
			u64 ggtt_offset;
-
 
955
			uint32_t pixel_format;
-
 
956
			unsigned int stride;
-
 
957
			int fence_reg;
920
	bool false_color;
958
		} fb;
921
 
959
 
-
 
960
		int cfb_size;
922
	bool enabled;
961
	} params;
923
	bool active;
-
 
924
 
-
 
925
	struct intel_fbc_work {
962
 
Line 926... Line 963...
926
		bool scheduled;
963
	struct intel_fbc_work {
927
		struct work_struct work;
-
 
928
		struct drm_framebuffer *fb;
-
 
929
		unsigned long enable_jiffies;
-
 
930
	} work;
-
 
931
 
964
		bool scheduled;
Line 932... Line 965...
932
	const char *no_fbc_reason;
965
		u32 scheduled_vblank;
933
 
966
		struct work_struct work;
934
	bool (*is_active)(struct drm_i915_private *dev_priv);
967
	} work;
Line 971... Line 1004...
971
	bool active;
1004
	bool active;
972
	struct delayed_work work;
1005
	struct delayed_work work;
973
	unsigned busy_frontbuffer_bits;
1006
	unsigned busy_frontbuffer_bits;
974
	bool psr2_support;
1007
	bool psr2_support;
975
	bool aux_frame_sync;
1008
	bool aux_frame_sync;
-
 
1009
	bool link_standby;
976
};
1010
};
Line 977... Line 1011...
977
 
1011
 
978
enum intel_pch {
1012
enum intel_pch {
979
	PCH_NONE = 0,	/* No PCH present */
1013
	PCH_NONE = 0,	/* No PCH present */
Line 1297... Line 1331...
1297
	 * is a slight delay before we do so.
1331
	 * is a slight delay before we do so.
1298
	 */
1332
	 */
1299
	bool busy;
1333
	bool busy;
Line 1300... Line 1334...
1300
 
1334
 
1301
	/* the indicator for dispatch video commands on two BSD rings */
1335
	/* the indicator for dispatch video commands on two BSD rings */
Line 1302... Line 1336...
1302
	int bsd_ring_dispatch_index;
1336
	unsigned int bsd_ring_dispatch_index;
1303
 
1337
 
1304
	/** Bit 6 swizzling required for X tiling */
1338
	/** Bit 6 swizzling required for X tiling */
1305
	uint32_t bit_6_swizzle_x;
1339
	uint32_t bit_6_swizzle_x;
Line 1483... Line 1517...
1483
		struct mipi_config *config;
1517
		struct mipi_config *config;
1484
		struct mipi_pps_data *pps;
1518
		struct mipi_pps_data *pps;
1485
		u8 seq_version;
1519
		u8 seq_version;
1486
		u32 size;
1520
		u32 size;
1487
		u8 *data;
1521
		u8 *data;
1488
		u8 *sequence[MIPI_SEQ_MAX];
1522
		const u8 *sequence[MIPI_SEQ_MAX];
1489
	} dsi;
1523
	} dsi;
Line 1490... Line 1524...
1490
 
1524
 
Line 1491... Line 1525...
1491
	int crt_ddc_pin;
1525
	int crt_ddc_pin;
Line 1655... Line 1689...
1655
	u32 value;
1689
	u32 value;
1656
	/* bitmask representing WA bits */
1690
	/* bitmask representing WA bits */
1657
	u32 mask;
1691
	u32 mask;
1658
};
1692
};
Line -... Line 1693...
-
 
1693
 
-
 
1694
/*
-
 
1695
 * RING_MAX_NONPRIV_SLOTS is per-engine but at this point we are only
-
 
1696
 * allowing it for RCS as we don't foresee any requirement of having
-
 
1697
 * a whitelist for other engines. When it is really required for
-
 
1698
 * other engines then the limit need to be increased.
1659
 
1699
 */
Line 1660... Line 1700...
1660
#define I915_MAX_WA_REGS 16
1700
#define I915_MAX_WA_REGS (16 + RING_MAX_NONPRIV_SLOTS)
1661
 
1701
 
1662
struct i915_workarounds {
1702
struct i915_workarounds {
-
 
1703
	struct i915_wa_reg reg[I915_MAX_WA_REGS];
1663
	struct i915_wa_reg reg[I915_MAX_WA_REGS];
1704
	u32 count;
Line 1664... Line 1705...
1664
	u32 count;
1705
	u32 hw_whitelist_count[I915_NUM_RINGS];
1665
};
1706
};
1666
 
1707
 
Line 1754... Line 1795...
1754
	u32 pm_irq_mask;
1795
	u32 pm_irq_mask;
1755
	u32 pm_rps_events;
1796
	u32 pm_rps_events;
1756
	u32 pipestat_irq_mask[I915_MAX_PIPES];
1797
	u32 pipestat_irq_mask[I915_MAX_PIPES];
Line 1757... Line 1798...
1757
 
1798
 
1758
	struct i915_hotplug hotplug;
1799
	struct i915_hotplug hotplug;
1759
	struct i915_fbc fbc;
1800
	struct intel_fbc fbc;
1760
	struct i915_drrs drrs;
1801
	struct i915_drrs drrs;
1761
	struct intel_opregion opregion;
1802
	struct intel_opregion opregion;
Line 1762... Line 1803...
1762
	struct intel_vbt_data vbt;
1803
	struct intel_vbt_data vbt;
Line 1778... Line 1819...
1778
	struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */
1819
	struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */
1779
	int num_fence_regs; /* 8 on pre-965, 16 otherwise */
1820
	int num_fence_regs; /* 8 on pre-965, 16 otherwise */
Line 1780... Line 1821...
1780
 
1821
 
1781
	unsigned int fsb_freq, mem_freq, is_ddr3;
1822
	unsigned int fsb_freq, mem_freq, is_ddr3;
1782
	unsigned int skl_boot_cdclk;
1823
	unsigned int skl_boot_cdclk;
1783
	unsigned int cdclk_freq, max_cdclk_freq;
1824
	unsigned int cdclk_freq, max_cdclk_freq, atomic_cdclk_freq;
1784
	unsigned int max_dotclk_freq;
1825
	unsigned int max_dotclk_freq;
1785
	unsigned int hpll_freq;
1826
	unsigned int hpll_freq;
Line 1786... Line 1827...
1786
	unsigned int czclk_freq;
1827
	unsigned int czclk_freq;
Line 1803... Line 1844...
1803
 
1844
 
Line 1804... Line 1845...
1804
	unsigned long quirks;
1845
	unsigned long quirks;
1805
 
1846
 
-
 
1847
	enum modeset_restore modeset_restore;
Line 1806... Line 1848...
1806
	enum modeset_restore modeset_restore;
1848
	struct mutex modeset_restore_lock;
1807
	struct mutex modeset_restore_lock;
1849
	struct drm_atomic_state *modeset_restore_state;
Line 1808... Line 1850...
1808
 
1850
 
Line 1823... Line 1865...
1823
 
1865
 
1824
#ifdef CONFIG_DEBUG_FS
1866
#ifdef CONFIG_DEBUG_FS
1825
	struct intel_pipe_crc pipe_crc[I915_MAX_PIPES];
1867
	struct intel_pipe_crc pipe_crc[I915_MAX_PIPES];
Line -... Line 1868...
-
 
1868
#endif
1826
#endif
1869
 
1827
 
1870
	/* dpll and cdclk state is protected by connection_mutex */
-
 
1871
	int num_shared_dpll;
-
 
1872
	struct intel_shared_dpll shared_dplls[I915_NUM_PLLS];
-
 
1873
 
-
 
1874
	unsigned int active_crtcs;
1828
	int num_shared_dpll;
1875
	unsigned int min_pixclk[I915_MAX_PIPES];
Line 1829... Line 1876...
1829
	struct intel_shared_dpll shared_dplls[I915_NUM_PLLS];
1876
 
Line 1830... Line 1877...
1830
	int dpio_phy_iosf_port[I915_NUM_PHYS_VLV];
1877
	int dpio_phy_iosf_port[I915_NUM_PHYS_VLV];
Line 1939... Line 1986...
1939
		int (*init_rings)(struct drm_device *dev);
1986
		int (*init_rings)(struct drm_device *dev);
1940
		void (*cleanup_ring)(struct intel_engine_cs *ring);
1987
		void (*cleanup_ring)(struct intel_engine_cs *ring);
1941
		void (*stop_ring)(struct intel_engine_cs *ring);
1988
		void (*stop_ring)(struct intel_engine_cs *ring);
1942
	} gt;
1989
	} gt;
Line -... Line 1990...
-
 
1990
 
-
 
1991
	struct intel_context *kernel_context;
1943
 
1992
 
Line 1944... Line 1993...
1944
	bool edp_low_vswing;
1993
	bool edp_low_vswing;
1945
 
1994
 
Line 2263... Line 2312...
2263
	/** Execlists no. of times this request has been sent to the ELSP */
2312
	/** Execlists no. of times this request has been sent to the ELSP */
2264
	int elsp_submitted;
2313
	int elsp_submitted;
Line 2265... Line 2314...
2265
 
2314
 
Line -... Line 2315...
-
 
2315
};
2266
};
2316
 
2267
 
2317
struct drm_i915_gem_request * __must_check
2268
int i915_gem_request_alloc(struct intel_engine_cs *ring,
-
 
2269
			   struct intel_context *ctx,
2318
i915_gem_request_alloc(struct intel_engine_cs *engine,
2270
			   struct drm_i915_gem_request **req_out);
2319
		       struct intel_context *ctx);
2271
void i915_gem_request_cancel(struct drm_i915_gem_request *req);
2320
void i915_gem_request_cancel(struct drm_i915_gem_request *req);
2272
void i915_gem_request_free(struct kref *req_ref);
2321
void i915_gem_request_free(struct kref *req_ref);
Line 2574... Line 2623...
2574
#define HAS_OVERLAY(dev)		(INTEL_INFO(dev)->has_overlay)
2623
#define HAS_OVERLAY(dev)		(INTEL_INFO(dev)->has_overlay)
2575
#define OVERLAY_NEEDS_PHYSICAL(dev)	(INTEL_INFO(dev)->overlay_needs_physical)
2624
#define OVERLAY_NEEDS_PHYSICAL(dev)	(INTEL_INFO(dev)->overlay_needs_physical)
Line 2576... Line 2625...
2576
 
2625
 
2577
/* Early gen2 have a totally busted CS tlb and require pinned batches. */
2626
/* Early gen2 have a totally busted CS tlb and require pinned batches. */
-
 
2627
#define HAS_BROKEN_CS_TLB(dev)		(IS_I830(dev) || IS_845G(dev))
-
 
2628
 
-
 
2629
/* WaRsDisableCoarsePowerGating:skl,bxt */
-
 
2630
#define NEEDS_WaRsDisableCoarsePowerGating(dev) (IS_BXT_REVID(dev, 0, BXT_REVID_A1) || \
-
 
2631
						 IS_SKL_GT3(dev) || \
-
 
2632
						 IS_SKL_GT4(dev))
2578
#define HAS_BROKEN_CS_TLB(dev)		(IS_I830(dev) || IS_845G(dev))
2633
 
2579
/*
2634
/*
2580
 * dp aux and gmbus irq on gen4 seems to be able to generate legacy interrupts
2635
 * dp aux and gmbus irq on gen4 seems to be able to generate legacy interrupts
2581
 * even when in MSI mode. This results in spurious interrupt warnings if the
2636
 * even when in MSI mode. This results in spurious interrupt warnings if the
2582
 * legacy irq no. is shared with another device. The kernel then disables that
2637
 * legacy irq no. is shared with another device. The kernel then disables that
Line 2663... Line 2718...
2663
extern int i915_max_ioctl;
2718
extern int i915_max_ioctl;
Line 2664... Line 2719...
2664
 
2719
 
2665
extern int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state);
2720
extern int i915_suspend_switcheroo(struct drm_device *dev, pm_message_t state);
Line 2666... Line -...
2666
extern int i915_resume_switcheroo(struct drm_device *dev);
-
 
2667
 
-
 
2668
/* i915_params.c */
-
 
2669
struct i915_params {
-
 
2670
	int modeset;
-
 
2671
	int panel_ignore_lid;
-
 
2672
	int semaphores;
-
 
2673
	int lvds_channel_mode;
-
 
2674
	int panel_use_ssc;
-
 
2675
	int vbt_sdvo_panel_type;
-
 
2676
	int enable_rc6;
-
 
2677
	int enable_dc;
-
 
2678
	int enable_fbc;
-
 
2679
	int enable_ppgtt;
-
 
2680
	int enable_execlists;
-
 
2681
	int enable_psr;
-
 
2682
	unsigned int preliminary_hw_support;
-
 
2683
	int disable_power_well;
-
 
2684
	int enable_ips;
-
 
2685
	int invert_brightness;
-
 
2686
	int enable_cmd_parser;
-
 
2687
	/* leave bools at the end to not create holes */
-
 
2688
	bool enable_hangcheck;
-
 
2689
	bool fastboot;
-
 
2690
	bool prefault_disable;
-
 
2691
	bool load_detect_test;
-
 
2692
	bool reset;
-
 
2693
	bool disable_display;
-
 
2694
	bool disable_vtd_wa;
-
 
2695
	bool enable_guc_submission;
-
 
2696
	int guc_log_level;
-
 
2697
	int use_mmio_flip;
-
 
2698
	int mmio_debug;
-
 
2699
	bool verbose_state_checks;
-
 
2700
	bool nuclear_pageflip;
-
 
2701
	int edp_vswing;
-
 
2702
                /* Kolibri related */
-
 
2703
    char *log_file;
-
 
2704
    char *cmdline_mode;
-
 
2705
};
-
 
2706
extern struct i915_params i915 __read_mostly;
2721
extern int i915_resume_switcheroo(struct drm_device *dev);
2707
 
2722
 
2708
				/* i915_dma.c */
2723
/* i915_dma.c */
2709
extern int i915_driver_load(struct drm_device *, unsigned long flags);
2724
extern int i915_driver_load(struct drm_device *, unsigned long flags);
2710
extern int i915_driver_unload(struct drm_device *);
2725
extern int i915_driver_unload(struct drm_device *);
Line 2746... Line 2761...
2746
 
2761
 
2747
extern void intel_uncore_sanitize(struct drm_device *dev);
2762
extern void intel_uncore_sanitize(struct drm_device *dev);
2748
extern void intel_uncore_early_sanitize(struct drm_device *dev,
2763
extern void intel_uncore_early_sanitize(struct drm_device *dev,
2749
					bool restore_forcewake);
2764
					bool restore_forcewake);
2750
extern void intel_uncore_init(struct drm_device *dev);
2765
extern void intel_uncore_init(struct drm_device *dev);
-
 
2766
extern bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv);
2751
extern void intel_uncore_check_errors(struct drm_device *dev);
2767
extern bool intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv);
2752
extern void intel_uncore_fini(struct drm_device *dev);
2768
extern void intel_uncore_fini(struct drm_device *dev);
2753
extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
2769
extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
2754
const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);
2770
const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);
2755
void intel_uncore_forcewake_get(struct drm_i915_private *dev_priv,
2771
void intel_uncore_forcewake_get(struct drm_i915_private *dev_priv,
Line 2868... Line 2884...
2868
			   struct drm_file *file);
2884
			   struct drm_file *file);
2869
int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
2885
int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
2870
				struct drm_file *file_priv);
2886
				struct drm_file *file_priv);
2871
int i915_gem_wait_ioctl(struct drm_device *dev, void *data,
2887
int i915_gem_wait_ioctl(struct drm_device *dev, void *data,
2872
			struct drm_file *file_priv);
2888
			struct drm_file *file_priv);
2873
void i915_gem_load(struct drm_device *dev);
2889
void i915_gem_load_init(struct drm_device *dev);
-
 
2890
void i915_gem_load_cleanup(struct drm_device *dev);
2874
void *i915_gem_object_alloc(struct drm_device *dev);
2891
void *i915_gem_object_alloc(struct drm_device *dev);
2875
void i915_gem_object_free(struct drm_i915_gem_object *obj);
2892
void i915_gem_object_free(struct drm_i915_gem_object *obj);
2876
void i915_gem_object_init(struct drm_i915_gem_object *obj,
2893
void i915_gem_object_init(struct drm_i915_gem_object *obj,
2877
			 const struct drm_i915_gem_object_ops *ops);
2894
			 const struct drm_i915_gem_object_ops *ops);
2878
struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
2895
struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
Line 3132... Line 3149...
3132
bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj);
3149
bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj);
Line 3133... Line 3150...
3133
 
3150
 
3134
/* Some GGTT VM helpers */
3151
/* Some GGTT VM helpers */
3135
#define i915_obj_to_ggtt(obj) \
3152
#define i915_obj_to_ggtt(obj) \
3136
	(&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base)
-
 
3137
static inline bool i915_is_ggtt(struct i915_address_space *vm)
-
 
3138
{
-
 
3139
	struct i915_address_space *ggtt =
-
 
3140
		&((struct drm_i915_private *)(vm)->dev->dev_private)->gtt.base;
-
 
3141
	return vm == ggtt;
-
 
Line 3142... Line 3153...
3142
}
3153
	(&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base)
3143
 
3154
 
3144
static inline struct i915_hw_ppgtt *
3155
static inline struct i915_hw_ppgtt *
3145
i915_vm_to_ppgtt(struct i915_address_space *vm)
3156
i915_vm_to_ppgtt(struct i915_address_space *vm)
3146
{
-
 
3147
	WARN_ON(i915_is_ggtt(vm));
3157
{
3148
 
3158
	WARN_ON(i915_is_ggtt(vm));
Line 3149... Line 3159...
3149
	return container_of(vm, struct i915_hw_ppgtt, base);
3159
	return container_of(vm, struct i915_hw_ppgtt, base);
Line 3281... Line 3291...
3281
#define I915_SHRINK_UNBOUND 0x2
3291
#define I915_SHRINK_UNBOUND 0x2
3282
#define I915_SHRINK_BOUND 0x4
3292
#define I915_SHRINK_BOUND 0x4
3283
#define I915_SHRINK_ACTIVE 0x8
3293
#define I915_SHRINK_ACTIVE 0x8
3284
unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv);
3294
unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv);
3285
void i915_gem_shrinker_init(struct drm_i915_private *dev_priv);
3295
void i915_gem_shrinker_init(struct drm_i915_private *dev_priv);
-
 
3296
void i915_gem_shrinker_cleanup(struct drm_i915_private *dev_priv);
Line 3286... Line 3297...
3286
 
3297
 
3287
 
3298
 
3288
/* i915_gem_tiling.c */
3299
/* i915_gem_tiling.c */
Line 3451... Line 3462...
3451
 
3462
 
3452
/* intel_sideband.c */
3463
/* intel_sideband.c */
3453
u32 vlv_punit_read(struct drm_i915_private *dev_priv, u32 addr);
3464
u32 vlv_punit_read(struct drm_i915_private *dev_priv, u32 addr);
3454
void vlv_punit_write(struct drm_i915_private *dev_priv, u32 addr, u32 val);
3465
void vlv_punit_write(struct drm_i915_private *dev_priv, u32 addr, u32 val);
3455
u32 vlv_nc_read(struct drm_i915_private *dev_priv, u8 addr);
3466
u32 vlv_nc_read(struct drm_i915_private *dev_priv, u8 addr);
3456
u32 vlv_gpio_nc_read(struct drm_i915_private *dev_priv, u32 reg);
3467
u32 vlv_iosf_sb_read(struct drm_i915_private *dev_priv, u8 port, u32 reg);
3457
void vlv_gpio_nc_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3468
void vlv_iosf_sb_write(struct drm_i915_private *dev_priv, u8 port, u32 reg, u32 val);
3458
u32 vlv_cck_read(struct drm_i915_private *dev_priv, u32 reg);
3469
u32 vlv_cck_read(struct drm_i915_private *dev_priv, u32 reg);
3459
void vlv_cck_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3470
void vlv_cck_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3460
u32 vlv_ccu_read(struct drm_i915_private *dev_priv, u32 reg);
3471
u32 vlv_ccu_read(struct drm_i915_private *dev_priv, u32 reg);
3461
void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3472
void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3462
u32 vlv_bunit_read(struct drm_i915_private *dev_priv, u32 reg);
3473
u32 vlv_bunit_read(struct drm_i915_private *dev_priv, u32 reg);
3463
void vlv_bunit_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
-
 
3464
u32 vlv_gps_core_read(struct drm_i915_private *dev_priv, u32 reg);
-
 
3465
void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3474
void vlv_bunit_write(struct drm_i915_private *dev_priv, u32 reg, u32 val);
3466
u32 vlv_dpio_read(struct drm_i915_private *dev_priv, enum pipe pipe, int reg);
3475
u32 vlv_dpio_read(struct drm_i915_private *dev_priv, enum pipe pipe, int reg);
3467
void vlv_dpio_write(struct drm_i915_private *dev_priv, enum pipe pipe, int reg, u32 val);
3476
void vlv_dpio_write(struct drm_i915_private *dev_priv, enum pipe pipe, int reg, u32 val);
3468
u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg,
3477
u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg,
3469
		   enum intel_sbi_destination destination);
3478
		   enum intel_sbi_destination destination);
Line 3617... Line 3626...
3617
{
3626
{
3618
	if (ring->trace_irq_req == NULL && ring->irq_get(ring))
3627
	if (ring->trace_irq_req == NULL && ring->irq_get(ring))
3619
		i915_gem_request_assign(&ring->trace_irq_req, req);
3628
		i915_gem_request_assign(&ring->trace_irq_req, req);
3620
}
3629
}
Line 3621... Line -...
3621
 
-
 
3622
#include "intel_drv.h"
-
 
3623
 
3630