Subversion Repositories Kolibri OS

Rev

Rev 5128 | Rev 6084 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5128 Rev 5354
Line 33... Line 33...
33
#include 
33
#include 
Line 34... Line 34...
34
 
34
 
35
#include "i915_reg.h"
35
#include "i915_reg.h"
36
#include "intel_bios.h"
36
#include "intel_bios.h"
-
 
37
#include "intel_ringbuffer.h"
37
#include "intel_ringbuffer.h"
38
#include "intel_lrc.h"
-
 
39
#include "i915_gem_gtt.h"
38
#include "i915_gem_gtt.h"
40
#include "i915_gem_render_state.h"
39
//#include 
41
//#include 
40
#include 
42
#include 
41
#include 
43
#include 
-
 
44
#include 
-
 
45
#include  /* for struct drm_dma_handle */
42
#include 
46
#include 
43
//#include 
47
//#include 
Line 44... Line 48...
44
#include 
48
#include 
45
 
49
 
Line 46... Line 50...
46
#include 
50
#include 
47
#include 
51
#include 
Line 48... Line -...
48
 
-
 
49
 
-
 
50
/* General customization:
-
 
51
 */
-
 
52
 
-
 
53
#define I915_TILING_NONE          0
-
 
54
 
-
 
55
#define VGA_RSRC_NONE          0x00
-
 
56
#define VGA_RSRC_LEGACY_IO     0x01
-
 
57
#define VGA_RSRC_LEGACY_MEM    0x02
-
 
58
#define VGA_RSRC_LEGACY_MASK   (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)
-
 
59
/* Non-legacy access */
-
 
60
#define VGA_RSRC_NORMAL_IO     0x04
52
 
61
#define VGA_RSRC_NORMAL_MEM    0x08
53
 
62
 
54
/* General customization:
-
 
55
 */
-
 
56
 
-
 
57
#define DRIVER_NAME		"i915"
Line 63... Line 58...
63
#define DRIVER_AUTHOR		"Tungsten Graphics, Inc."
58
#define DRIVER_DESC		"Intel Graphics"
64
 
59
#define DRIVER_DATE		"20141121"
65
#define DRIVER_NAME		"i915"
60
 
66
#define DRIVER_DESC		"Intel Graphics"
61
#undef WARN_ON
Line 83... Line 78...
83
	TRANSCODER_EDP,
78
	TRANSCODER_EDP,
84
	I915_MAX_TRANSCODERS
79
	I915_MAX_TRANSCODERS
85
};
80
};
86
#define transcoder_name(t) ((t) + 'A')
81
#define transcoder_name(t) ((t) + 'A')
Line -... Line 82...
-
 
82
 
-
 
83
/*
-
 
84
 * This is the maximum (across all platforms) number of planes (primary +
-
 
85
 * sprites) that can be active at the same time on one pipe.
-
 
86
 *
-
 
87
 * This value doesn't count the cursor plane.
-
 
88
 */
-
 
89
#define I915_MAX_PLANES	3
87
 
90
 
88
enum plane {
91
enum plane {
89
	PLANE_A = 0,
92
	PLANE_A = 0,
90
	PLANE_B,
93
	PLANE_B,
91
	PLANE_C,
94
	PLANE_C,
Line 171... Line 174...
171
	 I915_GEM_DOMAIN_SAMPLER | \
174
	 I915_GEM_DOMAIN_SAMPLER | \
172
	 I915_GEM_DOMAIN_COMMAND | \
175
	 I915_GEM_DOMAIN_COMMAND | \
173
	 I915_GEM_DOMAIN_INSTRUCTION | \
176
	 I915_GEM_DOMAIN_INSTRUCTION | \
174
	 I915_GEM_DOMAIN_VERTEX)
177
	 I915_GEM_DOMAIN_VERTEX)
Line -... Line 178...
-
 
178
 
175
 
179
#define for_each_pipe(__dev_priv, __p) \
-
 
180
	for ((__p) = 0; (__p) < INTEL_INFO(__dev_priv)->num_pipes; (__p)++)
-
 
181
#define for_each_plane(pipe, p) \
176
#define for_each_pipe(p) for ((p) = 0; (p) < INTEL_INFO(dev)->num_pipes; (p)++)
182
	for ((p) = 0; (p) < INTEL_INFO(dev)->num_sprites[(pipe)] + 1; (p)++)
Line 177... Line 183...
177
#define for_each_sprite(p, s) for ((s) = 0; (s) < INTEL_INFO(dev)->num_sprites[(p)]; (s)++)
183
#define for_each_sprite(p, s) for ((s) = 0; (s) < INTEL_INFO(dev)->num_sprites[(p)]; (s)++)
178
 
184
 
Line 179... Line 185...
179
#define for_each_crtc(dev, crtc) \
185
#define for_each_crtc(dev, crtc) \
180
	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
186
	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
Line -... Line 187...
-
 
187
 
-
 
188
#define for_each_intel_crtc(dev, intel_crtc) \
-
 
189
	list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, base.head)
-
 
190
 
-
 
191
#define for_each_intel_encoder(dev, intel_encoder)		\
181
 
192
	list_for_each_entry(intel_encoder,			\
182
#define for_each_intel_crtc(dev, intel_crtc) \
193
			    &(dev)->mode_config.encoder_list,	\
183
	list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, base.head)
194
			    base.head)
Line 184... Line 195...
184
 
195
 
Line 201... Line 212...
201
enum intel_dpll_id {
212
enum intel_dpll_id {
202
	DPLL_ID_PRIVATE = -1, /* non-shared dpll in use */
213
	DPLL_ID_PRIVATE = -1, /* non-shared dpll in use */
203
	/* real shared dpll ids must be >= 0 */
214
	/* real shared dpll ids must be >= 0 */
204
	DPLL_ID_PCH_PLL_A = 0,
215
	DPLL_ID_PCH_PLL_A = 0,
205
	DPLL_ID_PCH_PLL_B = 1,
216
	DPLL_ID_PCH_PLL_B = 1,
-
 
217
	/* hsw/bdw */
206
	DPLL_ID_WRPLL1 = 0,
218
	DPLL_ID_WRPLL1 = 0,
207
	DPLL_ID_WRPLL2 = 1,
219
	DPLL_ID_WRPLL2 = 1,
-
 
220
	/* skl */
-
 
221
	DPLL_ID_SKL_DPLL1 = 0,
-
 
222
	DPLL_ID_SKL_DPLL2 = 1,
-
 
223
	DPLL_ID_SKL_DPLL3 = 2,
208
};
224
};
209
#define I915_NUM_PLLS 2
225
#define I915_NUM_PLLS 3
Line 210... Line 226...
210
 
226
 
-
 
227
struct intel_dpll_hw_state {
211
struct intel_dpll_hw_state {
228
	/* i9xx, pch plls */
212
	uint32_t dpll;
229
	uint32_t dpll;
213
	uint32_t dpll_md;
230
	uint32_t dpll_md;
214
	uint32_t fp0;
231
	uint32_t fp0;
-
 
232
	uint32_t fp1;
-
 
233
 
215
	uint32_t fp1;
234
	/* hsw, bdw */
-
 
235
	uint32_t wrpll;
-
 
236
 
-
 
237
	/* skl */
-
 
238
	/*
-
 
239
	 * DPLL_CTRL1 has 6 bits for each each this DPLL. We store those in
-
 
240
	 * lower part of crtl1 and they get shifted into position when writing
-
 
241
	 * the register.  This allows us to easily compare the state to share
-
 
242
	 * the DPLL.
-
 
243
	 */
-
 
244
	uint32_t ctrl1;
-
 
245
	/* HDMI only, 0 when used for DP */
-
 
246
	uint32_t cfgcr1, cfgcr2;
-
 
247
};
-
 
248
 
-
 
249
struct intel_shared_dpll_config {
-
 
250
	unsigned crtc_mask; /* mask of CRTCs sharing this PLL */
216
	uint32_t wrpll;
251
	struct intel_dpll_hw_state hw_state;
Line 217... Line 252...
217
};
252
};
-
 
253
 
218
 
254
struct intel_shared_dpll {
-
 
255
	struct intel_shared_dpll_config config;
219
struct intel_shared_dpll {
256
	struct intel_shared_dpll_config *new_config;
220
	int refcount; /* count of number of CRTCs sharing this PLL */
257
 
221
	int active; /* count of number of active CRTCs (i.e. DPMS on) */
258
	int active; /* count of number of active CRTCs (i.e. DPMS on) */
222
	bool on; /* is the PLL actually active? Disabled during modeset */
259
	bool on; /* is the PLL actually active? Disabled during modeset */
223
	const char *name;
260
	const char *name;
224
	/* should match the index in the dev_priv->shared_dplls array */
-
 
225
	enum intel_dpll_id id;
261
	/* should match the index in the dev_priv->shared_dplls array */
226
	struct intel_dpll_hw_state hw_state;
262
	enum intel_dpll_id id;
227
	/* The mode_set hook is optional and should be used together with the
263
	/* The mode_set hook is optional and should be used together with the
228
	 * intel_prepare_shared_dpll function. */
264
	 * intel_prepare_shared_dpll function. */
229
	void (*mode_set)(struct drm_i915_private *dev_priv,
265
	void (*mode_set)(struct drm_i915_private *dev_priv,
Line 235... Line 271...
235
	bool (*get_hw_state)(struct drm_i915_private *dev_priv,
271
	bool (*get_hw_state)(struct drm_i915_private *dev_priv,
236
			     struct intel_shared_dpll *pll,
272
			     struct intel_shared_dpll *pll,
237
			     struct intel_dpll_hw_state *hw_state);
273
			     struct intel_dpll_hw_state *hw_state);
238
};
274
};
Line -... Line 275...
-
 
275
 
-
 
276
#define SKL_DPLL0 0
-
 
277
#define SKL_DPLL1 1
-
 
278
#define SKL_DPLL2 2
-
 
279
#define SKL_DPLL3 3
239
 
280
 
240
/* Used by dp and fdi links */
281
/* Used by dp and fdi links */
241
struct intel_link_m_n {
282
struct intel_link_m_n {
242
	uint32_t	tu;
283
	uint32_t	tu;
243
	uint32_t	gmch_m;
284
	uint32_t	gmch_m;
Line 263... Line 304...
263
#define DRIVER_MAJOR		1
304
#define DRIVER_MAJOR		1
264
#define DRIVER_MINOR		6
305
#define DRIVER_MINOR		6
265
#define DRIVER_PATCHLEVEL	0
306
#define DRIVER_PATCHLEVEL	0
Line 266... Line 307...
266
 
307
 
267
#define WATCH_LISTS	0
-
 
Line 268... Line 308...
268
#define WATCH_GTT	0
308
#define WATCH_LISTS	0
269
 
309
 
270
struct opregion_header;
310
struct opregion_header;
271
struct opregion_acpi;
311
struct opregion_acpi;
Line 286... Line 326...
286
#define OPREGION_SIZE            (8*1024)
326
#define OPREGION_SIZE            (8*1024)
Line 287... Line 327...
287
 
327
 
288
struct intel_overlay;
328
struct intel_overlay;
Line 289... Line -...
289
struct intel_overlay_error_state;
-
 
290
 
-
 
291
struct drm_i915_master_private {
-
 
292
	drm_local_map_t *sarea;
-
 
293
	struct _drm_i915_sarea *sarea_priv;
329
struct intel_overlay_error_state;
294
};
330
 
295
#define I915_FENCE_REG_NONE -1
331
#define I915_FENCE_REG_NONE -1
296
#define I915_MAX_NUM_FENCES 32
332
#define I915_MAX_NUM_FENCES 32
Line 396... Line 432...
396
		} vm_info;
432
		} vm_info;
Line 397... Line 433...
397
 
433
 
398
		pid_t pid;
434
		pid_t pid;
399
		char comm[TASK_COMM_LEN];
435
		char comm[TASK_COMM_LEN];
-
 
436
	} ring[I915_NUM_RINGS];
400
	} ring[I915_NUM_RINGS];
437
 
401
	struct drm_i915_error_buffer {
438
	struct drm_i915_error_buffer {
402
		u32 size;
439
		u32 size;
403
		u32 name;
440
		u32 name;
404
		u32 rseqno, wseqno;
441
		u32 rseqno, wseqno;
Line 414... Line 451...
414
		s32 ring:4;
451
		s32 ring:4;
415
		u32 cache_level:3;
452
		u32 cache_level:3;
416
	} **active_bo, **pinned_bo;
453
	} **active_bo, **pinned_bo;
Line 417... Line 454...
417
 
454
 
-
 
455
	u32 *active_bo_count, *pinned_bo_count;
418
	u32 *active_bo_count, *pinned_bo_count;
456
	u32 vm_count;
Line 419... Line 457...
419
};
457
};
-
 
458
 
420
 
459
struct intel_connector;
421
struct intel_connector;
460
struct intel_encoder;
422
struct intel_crtc_config;
461
struct intel_crtc_config;
423
struct intel_plane_config;
462
struct intel_plane_config;
424
struct intel_crtc;
463
struct intel_crtc;
Line 443... Line 482...
443
	 * @best_clock: best PLL values found
482
	 * @best_clock: best PLL values found
444
	 *
483
	 *
445
	 * Returns true on success, false on failure.
484
	 * Returns true on success, false on failure.
446
	 */
485
	 */
447
	bool (*find_dpll)(const struct intel_limit *limit,
486
	bool (*find_dpll)(const struct intel_limit *limit,
448
			  struct drm_crtc *crtc,
487
			  struct intel_crtc *crtc,
449
			  int target, int refclk,
488
			  int target, int refclk,
450
			  struct dpll *match_clock,
489
			  struct dpll *match_clock,
451
			  struct dpll *best_clock);
490
			  struct dpll *best_clock);
452
	void (*update_wm)(struct drm_crtc *crtc);
491
	void (*update_wm)(struct drm_crtc *crtc);
453
	void (*update_sprite_wm)(struct drm_plane *plane,
492
	void (*update_sprite_wm)(struct drm_plane *plane,
Line 459... Line 498...
459
	 * fills out the pipe-config with the hw state. */
498
	 * fills out the pipe-config with the hw state. */
460
	bool (*get_pipe_config)(struct intel_crtc *,
499
	bool (*get_pipe_config)(struct intel_crtc *,
461
				struct intel_crtc_config *);
500
				struct intel_crtc_config *);
462
	void (*get_plane_config)(struct intel_crtc *,
501
	void (*get_plane_config)(struct intel_crtc *,
463
				 struct intel_plane_config *);
502
				 struct intel_plane_config *);
464
	int (*crtc_mode_set)(struct drm_crtc *crtc,
503
	int (*crtc_compute_clock)(struct intel_crtc *crtc);
465
			     int x, int y,
-
 
466
			     struct drm_framebuffer *old_fb);
-
 
467
	void (*crtc_enable)(struct drm_crtc *crtc);
504
	void (*crtc_enable)(struct drm_crtc *crtc);
468
	void (*crtc_disable)(struct drm_crtc *crtc);
505
	void (*crtc_disable)(struct drm_crtc *crtc);
469
	void (*off)(struct drm_crtc *crtc);
506
	void (*off)(struct drm_crtc *crtc);
470
	void (*write_eld)(struct drm_connector *connector,
507
	void (*audio_codec_enable)(struct drm_connector *connector,
471
			  struct drm_crtc *crtc,
508
				   struct intel_encoder *encoder,
472
			  struct drm_display_mode *mode);
509
			  struct drm_display_mode *mode);
-
 
510
	void (*audio_codec_disable)(struct intel_encoder *encoder);
473
	void (*fdi_link_train)(struct drm_crtc *crtc);
511
	void (*fdi_link_train)(struct drm_crtc *crtc);
474
	void (*init_clock_gating)(struct drm_device *dev);
512
	void (*init_clock_gating)(struct drm_device *dev);
475
	int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
513
	int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
476
			  struct drm_framebuffer *fb,
514
			  struct drm_framebuffer *fb,
477
			  struct drm_i915_gem_object *obj,
515
			  struct drm_i915_gem_object *obj,
Line 485... Line 523...
485
	/* cursor updates */
523
	/* cursor updates */
486
	/* render clock increase/decrease */
524
	/* render clock increase/decrease */
487
	/* display clock increase/decrease */
525
	/* display clock increase/decrease */
488
	/* pll clock increase/decrease */
526
	/* pll clock increase/decrease */
Line 489... Line 527...
489
 
527
 
490
	int (*setup_backlight)(struct intel_connector *connector);
528
	int (*setup_backlight)(struct intel_connector *connector, enum pipe pipe);
491
	uint32_t (*get_backlight)(struct intel_connector *connector);
529
	uint32_t (*get_backlight)(struct intel_connector *connector);
492
	void (*set_backlight)(struct intel_connector *connector,
530
	void (*set_backlight)(struct intel_connector *connector,
493
			      uint32_t level);
531
			      uint32_t level);
494
	void (*disable_backlight)(struct intel_connector *connector);
532
	void (*disable_backlight)(struct intel_connector *connector);
Line 524... Line 562...
524
	unsigned fifo_count;
562
	unsigned fifo_count;
525
	unsigned forcewake_count;
563
	unsigned forcewake_count;
Line 526... Line 564...
526
 
564
 
527
	unsigned fw_rendercount;
565
	unsigned fw_rendercount;
-
 
566
	unsigned fw_mediacount;
Line 528... Line 567...
528
	unsigned fw_mediacount;
567
	unsigned fw_blittercount;
529
 
568
 
Line 530... Line 569...
530
	struct timer_list force_wake_timer;
569
	struct timer_list force_wake_timer;
Line 542... Line 581...
542
	func(is_broadwater) sep \
581
	func(is_broadwater) sep \
543
	func(is_crestline) sep \
582
	func(is_crestline) sep \
544
	func(is_ivybridge) sep \
583
	func(is_ivybridge) sep \
545
	func(is_valleyview) sep \
584
	func(is_valleyview) sep \
546
	func(is_haswell) sep \
585
	func(is_haswell) sep \
-
 
586
	func(is_skylake) sep \
547
	func(is_preliminary) sep \
587
	func(is_preliminary) sep \
548
	func(has_fbc) sep \
588
	func(has_fbc) sep \
549
	func(has_pipe_cxsr) sep \
589
	func(has_pipe_cxsr) sep \
550
	func(has_hotplug) sep \
590
	func(has_hotplug) sep \
551
	func(cursor_needs_physical) sep \
591
	func(cursor_needs_physical) sep \
Line 559... Line 599...
559
#define DEFINE_FLAG(name) u8 name:1
599
#define DEFINE_FLAG(name) u8 name:1
560
#define SEP_SEMICOLON ;
600
#define SEP_SEMICOLON ;
Line 561... Line 601...
561
 
601
 
562
struct intel_device_info {
602
struct intel_device_info {
-
 
603
	u32 display_mmio_offset;
563
	u32 display_mmio_offset;
604
	u16 device_id;
564
	u8 num_pipes:3;
605
	u8 num_pipes:3;
565
	u8 num_sprites[I915_MAX_PIPES];
606
	u8 num_sprites[I915_MAX_PIPES];
566
	u8 gen;
607
	u8 gen;
567
	u8 ring_mask; /* Rings supported by the HW */
608
	u8 ring_mask; /* Rings supported by the HW */
Line 623... Line 664...
623
	struct kref ref;
664
	struct kref ref;
624
	int user_handle;
665
	int user_handle;
625
	uint8_t remap_slice;
666
	uint8_t remap_slice;
626
	struct drm_i915_file_private *file_priv;
667
	struct drm_i915_file_private *file_priv;
627
	struct i915_ctx_hang_stats hang_stats;
668
	struct i915_ctx_hang_stats hang_stats;
628
	struct i915_address_space *vm;
669
	struct i915_hw_ppgtt *ppgtt;
Line -... Line 670...
-
 
670
 
629
 
671
	/* Legacy ring buffer submission */
630
	struct {
672
	struct {
631
		struct drm_i915_gem_object *rcs_state;
673
		struct drm_i915_gem_object *rcs_state;
632
		bool initialized;
674
		bool initialized;
Line -... Line 675...
-
 
675
	} legacy_hw_ctx;
-
 
676
 
-
 
677
	/* Execlists */
-
 
678
	bool rcs_initialized;
-
 
679
	struct {
-
 
680
		struct drm_i915_gem_object *state;
-
 
681
		struct intel_ringbuffer *ringbuf;
-
 
682
		int unpin_count;
633
	} legacy_hw_ctx;
683
	} engine[I915_NUM_RINGS];
634
 
684
 
Line 635... Line 685...
635
	struct list_head link;
685
	struct list_head link;
636
};
686
};
Line 643... Line 693...
643
	int y;
693
	int y;
Line 644... Line 694...
644
 
694
 
645
	struct drm_mm_node compressed_fb;
695
	struct drm_mm_node compressed_fb;
Line -... Line 696...
-
 
696
	struct drm_mm_node *compressed_llb;
-
 
697
 
-
 
698
	bool false_color;
-
 
699
 
-
 
700
	/* Tracks whether the HW is actually enabled, not whether the feature is
-
 
701
	 * possible. */
-
 
702
	bool enabled;
-
 
703
 
-
 
704
	/* On gen8 some rings cannont perform fbc clean operation so for now
-
 
705
	 * we are doing this on SW with mmio.
-
 
706
	 * This variable works in the opposite information direction
-
 
707
	 * of ring->fbc_dirty telling software on frontbuffer tracking
-
 
708
	 * to perform the cache clean on sw side.
-
 
709
	 */
646
	struct drm_mm_node *compressed_llb;
710
	bool need_sw_cache_clean;
647
 
711
 
648
	struct intel_fbc_work {
712
	struct intel_fbc_work {
649
		struct delayed_work work;
713
		struct delayed_work work;
650
		struct drm_crtc *crtc;
714
		struct drm_crtc *crtc;
Line 684... Line 748...
684
enum intel_pch {
748
enum intel_pch {
685
	PCH_NONE = 0,	/* No PCH present */
749
	PCH_NONE = 0,	/* No PCH present */
686
	PCH_IBX,	/* Ibexpeak PCH */
750
	PCH_IBX,	/* Ibexpeak PCH */
687
	PCH_CPT,	/* Cougarpoint PCH */
751
	PCH_CPT,	/* Cougarpoint PCH */
688
	PCH_LPT,	/* Lynxpoint PCH */
752
	PCH_LPT,	/* Lynxpoint PCH */
-
 
753
	PCH_SPT,        /* Sunrisepoint PCH */
689
	PCH_NOP,
754
	PCH_NOP,
690
};
755
};
Line 691... Line 756...
691
 
756
 
692
enum intel_sbi_destination {
757
enum intel_sbi_destination {
Line 696... Line 761...
696
 
761
 
697
#define QUIRK_PIPEA_FORCE (1<<0)
762
#define QUIRK_PIPEA_FORCE (1<<0)
698
#define QUIRK_LVDS_SSC_DISABLE (1<<1)
763
#define QUIRK_LVDS_SSC_DISABLE (1<<1)
699
#define QUIRK_INVERT_BRIGHTNESS (1<<2)
764
#define QUIRK_INVERT_BRIGHTNESS (1<<2)
-
 
765
#define QUIRK_BACKLIGHT_PRESENT (1<<3)
-
 
766
#define QUIRK_PIPEB_FORCE (1<<4)
Line 700... Line 767...
700
#define QUIRK_BACKLIGHT_PRESENT (1<<3)
767
#define QUIRK_PIN_SWIZZLED_PAGES (1<<5)
701
 
768
 
Line 702... Line 769...
702
struct intel_fbdev;
769
struct intel_fbdev;
Line 747... Line 814...
747
	u32 saveDSPATILEOFF;
814
	u32 saveDSPATILEOFF;
748
	u32 savePFIT_PGM_RATIOS;
815
	u32 savePFIT_PGM_RATIOS;
749
	u32 saveBLC_HIST_CTL;
816
	u32 saveBLC_HIST_CTL;
750
	u32 saveBLC_PWM_CTL;
817
	u32 saveBLC_PWM_CTL;
751
	u32 saveBLC_PWM_CTL2;
818
	u32 saveBLC_PWM_CTL2;
752
	u32 saveBLC_HIST_CTL_B;
-
 
753
	u32 saveBLC_CPU_PWM_CTL;
819
	u32 saveBLC_CPU_PWM_CTL;
754
	u32 saveBLC_CPU_PWM_CTL2;
820
	u32 saveBLC_CPU_PWM_CTL2;
755
	u32 saveFPB0;
821
	u32 saveFPB0;
756
	u32 saveFPB1;
822
	u32 saveFPB1;
757
	u32 saveDPLL_B;
823
	u32 saveDPLL_B;
Line 856... Line 922...
856
	u32 savePIPEB_DATA_N1;
922
	u32 savePIPEB_DATA_N1;
857
	u32 savePIPEB_LINK_M1;
923
	u32 savePIPEB_LINK_M1;
858
	u32 savePIPEB_LINK_N1;
924
	u32 savePIPEB_LINK_N1;
859
	u32 saveMCHBAR_RENDER_STANDBY;
925
	u32 saveMCHBAR_RENDER_STANDBY;
860
	u32 savePCH_PORT_HOTPLUG;
926
	u32 savePCH_PORT_HOTPLUG;
-
 
927
	u16 saveGCDGMBUS;
861
};
928
};
Line 862... Line 929...
862
 
929
 
863
struct vlv_s0ix_state {
930
struct vlv_s0ix_state {
864
	/* GAM */
931
	/* GAM */
Line 926... Line 993...
926
	u32 render_c0;
993
	u32 render_c0;
927
	u32 media_c0;
994
	u32 media_c0;
928
};
995
};
Line 929... Line 996...
929
 
996
 
-
 
997
struct intel_gen6_power_mgmt {
930
struct intel_gen6_power_mgmt {
998
	/*
-
 
999
	 * work, interrupts_enabled and pm_iir are protected by
-
 
1000
	 * dev_priv->irq_lock
931
	/* work and pm_iir are protected by dev_priv->irq_lock */
1001
	 */
-
 
1002
	struct work_struct work;
932
	struct work_struct work;
1003
	bool interrupts_enabled;
Line 933... Line 1004...
933
	u32 pm_iir;
1004
	u32 pm_iir;
934
 
1005
 
935
	/* Frequencies are stored in potentially platform dependent multiples.
1006
	/* Frequencies are stored in potentially platform dependent multiples.
Line 1050... Line 1121...
1050
	struct mutex lock;
1121
	struct mutex lock;
1051
	int domain_use_count[POWER_DOMAIN_NUM];
1122
	int domain_use_count[POWER_DOMAIN_NUM];
1052
	struct i915_power_well *power_wells;
1123
	struct i915_power_well *power_wells;
1053
};
1124
};
Line 1054... Line -...
1054
 
-
 
1055
struct i915_dri1_state {
-
 
1056
	unsigned allow_batchbuffer : 1;
-
 
1057
	u32 __iomem *gfx_hws_cpu_addr;
-
 
1058
 
-
 
1059
	unsigned int cpp;
-
 
1060
	int back_offset;
-
 
1061
	int front_offset;
-
 
1062
	int current_page;
-
 
1063
	int page_flipping;
-
 
1064
 
-
 
1065
	uint32_t counter;
-
 
1066
};
-
 
1067
 
-
 
1068
struct i915_ums_state {
-
 
1069
	/**
-
 
1070
	 * Flag if the X Server, and thus DRM, is not currently in
-
 
1071
	 * control of the device.
-
 
1072
	 *
-
 
1073
	 * This is set between LeaveVT and EnterVT.  It needs to be
-
 
1074
	 * replaced with a semaphore.  It also needs to be
-
 
1075
	 * transitioned away from for kernel modesetting.
-
 
1076
	 */
-
 
1077
	int mm_suspended;
-
 
1078
};
-
 
1079
 
1125
 
1080
#define MAX_L3_SLICES 2
1126
#define MAX_L3_SLICES 2
1081
struct intel_l3_parity {
1127
struct intel_l3_parity {
1082
	u32 *remap_info[MAX_L3_SLICES];
1128
	u32 *remap_info[MAX_L3_SLICES];
1083
	struct work_struct error_work;
1129
	struct work_struct error_work;
Line 1151... Line 1197...
1151
	size_t object_memory;
1197
	size_t object_memory;
1152
	u32 object_count;
1198
	u32 object_count;
1153
};
1199
};
Line 1154... Line 1200...
1154
 
1200
 
-
 
1201
struct drm_i915_error_state_buf {
1155
struct drm_i915_error_state_buf {
1202
	struct drm_i915_private *i915;
1156
	unsigned bytes;
1203
	unsigned bytes;
1157
	unsigned size;
1204
	unsigned size;
1158
	int err;
1205
	int err;
1159
	u8 *buf;
1206
	u8 *buf;
Line 1223... Line 1270...
1223
#define I915_STOP_RING_ALLOW_BAN       (1 << 31)
1270
#define I915_STOP_RING_ALLOW_BAN       (1 << 31)
1224
#define I915_STOP_RING_ALLOW_WARN      (1 << 30)
1271
#define I915_STOP_RING_ALLOW_WARN      (1 << 30)
Line 1225... Line 1272...
1225
 
1272
 
1226
	/* For missed irq/seqno simulation. */
1273
	/* For missed irq/seqno simulation. */
-
 
1274
	unsigned int test_irq_rings;
-
 
1275
 
-
 
1276
	/* Used to prevent gem_check_wedged returning -EAGAIN during gpu reset   */
1227
	unsigned int test_irq_rings;
1277
	bool reload_in_reset;
Line 1228... Line 1278...
1228
};
1278
};
1229
 
1279
 
1230
enum modeset_restore {
1280
enum modeset_restore {
1231
	MODESET_ON_LID_OPEN,
1281
	MODESET_ON_LID_OPEN,
1232
	MODESET_DONE,
1282
	MODESET_DONE,
Line 1233... Line 1283...
1233
	MODESET_SUSPENDED,
1283
	MODESET_SUSPENDED,
-
 
1284
};
-
 
1285
 
-
 
1286
struct ddi_vbt_port_info {
-
 
1287
	/*
-
 
1288
	 * This is an index in the HDMI/DVI DDI buffer translation table.
-
 
1289
	 * The special value HDMI_LEVEL_SHIFT_UNKNOWN means the VBT didn't
1234
};
1290
	 * populate this field.
Line 1235... Line 1291...
1235
 
1291
	 */
1236
struct ddi_vbt_port_info {
1292
#define HDMI_LEVEL_SHIFT_UNKNOWN	0xff
1237
	uint8_t hdmi_level_shift;
1293
	uint8_t hdmi_level_shift;
Line 1322... Line 1378...
1322
	uint32_t wm_linetime[3];
1378
	uint32_t wm_linetime[3];
1323
	bool enable_fbc_wm;
1379
	bool enable_fbc_wm;
1324
	enum intel_ddb_partitioning partitioning;
1380
	enum intel_ddb_partitioning partitioning;
1325
};
1381
};
Line -... Line 1382...
-
 
1382
 
-
 
1383
struct skl_ddb_entry {
-
 
1384
	uint16_t start, end;	/* in number of blocks, 'end' is exclusive */
-
 
1385
};
-
 
1386
 
-
 
1387
static inline uint16_t skl_ddb_entry_size(const struct skl_ddb_entry *entry)
-
 
1388
{
-
 
1389
	return entry->end - entry->start;
-
 
1390
}
-
 
1391
 
-
 
1392
static inline bool skl_ddb_entry_equal(const struct skl_ddb_entry *e1,
-
 
1393
				       const struct skl_ddb_entry *e2)
-
 
1394
{
-
 
1395
	if (e1->start == e2->start && e1->end == e2->end)
-
 
1396
		return true;
-
 
1397
 
-
 
1398
	return false;
-
 
1399
}
-
 
1400
 
-
 
1401
struct skl_ddb_allocation {
-
 
1402
	struct skl_ddb_entry pipe[I915_MAX_PIPES];
-
 
1403
	struct skl_ddb_entry plane[I915_MAX_PIPES][I915_MAX_PLANES];
-
 
1404
	struct skl_ddb_entry cursor[I915_MAX_PIPES];
-
 
1405
};
-
 
1406
 
-
 
1407
struct skl_wm_values {
-
 
1408
	bool dirty[I915_MAX_PIPES];
-
 
1409
	struct skl_ddb_allocation ddb;
-
 
1410
	uint32_t wm_linetime[I915_MAX_PIPES];
-
 
1411
	uint32_t plane[I915_MAX_PIPES][I915_MAX_PLANES][8];
-
 
1412
	uint32_t cursor[I915_MAX_PIPES][8];
-
 
1413
	uint32_t plane_trans[I915_MAX_PIPES][I915_MAX_PLANES];
-
 
1414
	uint32_t cursor_trans[I915_MAX_PIPES];
-
 
1415
};
-
 
1416
 
-
 
1417
struct skl_wm_level {
-
 
1418
	bool plane_en[I915_MAX_PLANES];
-
 
1419
	bool cursor_en;
-
 
1420
	uint16_t plane_res_b[I915_MAX_PLANES];
-
 
1421
	uint8_t plane_res_l[I915_MAX_PLANES];
-
 
1422
	uint16_t cursor_res_b;
-
 
1423
	uint8_t cursor_res_l;
-
 
1424
};
1326
 
1425
 
1327
/*
1426
/*
1328
 * This struct helps tracking the state needed for runtime PM, which puts the
1427
 * This struct helps tracking the state needed for runtime PM, which puts the
1329
 * device in PCI D3 state. Notice that when this happens, nothing on the
1428
 * device in PCI D3 state. Notice that when this happens, nothing on the
1330
 * graphics device works, even register access, so we don't get interrupts nor
1429
 * graphics device works, even register access, so we don't get interrupts nor
Line 1334... Line 1433...
1334
 * either call intel_runtime_pm_get or call intel_display_power_get with the
1433
 * either call intel_runtime_pm_get or call intel_display_power_get with the
1335
 * appropriate power domain.
1434
 * appropriate power domain.
1336
 *
1435
 *
1337
 * Our driver uses the autosuspend delay feature, which means we'll only really
1436
 * Our driver uses the autosuspend delay feature, which means we'll only really
1338
 * suspend if we stay with zero refcount for a certain amount of time. The
1437
 * suspend if we stay with zero refcount for a certain amount of time. The
1339
 * default value is currently very conservative (see intel_init_runtime_pm), but
1438
 * default value is currently very conservative (see intel_runtime_pm_enable), but
1340
 * it can be changed with the standard runtime PM files from sysfs.
1439
 * it can be changed with the standard runtime PM files from sysfs.
1341
 *
1440
 *
1342
 * The irqs_disabled variable becomes true exactly after we disable the IRQs and
1441
 * The irqs_disabled variable becomes true exactly after we disable the IRQs and
1343
 * goes back to false exactly before we reenable the IRQs. We use this variable
1442
 * goes back to false exactly before we reenable the IRQs. We use this variable
1344
 * to check if someone is trying to enable/disable IRQs while they're supposed
1443
 * to check if someone is trying to enable/disable IRQs while they're supposed
Line 1347... Line 1446...
1347
 *
1446
 *
1348
 * For more, read the Documentation/power/runtime_pm.txt.
1447
 * For more, read the Documentation/power/runtime_pm.txt.
1349
 */
1448
 */
1350
struct i915_runtime_pm {
1449
struct i915_runtime_pm {
1351
	bool suspended;
1450
	bool suspended;
1352
	bool _irqs_disabled;
1451
	bool irqs_enabled;
1353
};
1452
};
Line 1354... Line 1453...
1354
 
1453
 
1355
enum intel_pipe_crc_source {
1454
enum intel_pipe_crc_source {
1356
	INTEL_PIPE_CRC_SOURCE_NONE,
1455
	INTEL_PIPE_CRC_SOURCE_NONE,
Line 1391... Line 1490...
1391
	 */
1490
	 */
1392
	unsigned busy_bits;
1491
	unsigned busy_bits;
1393
	unsigned flip_bits;
1492
	unsigned flip_bits;
1394
};
1493
};
Line -... Line 1494...
-
 
1494
 
-
 
1495
struct i915_wa_reg {
-
 
1496
	u32 addr;
-
 
1497
	u32 value;
-
 
1498
	/* bitmask representing WA bits */
-
 
1499
	u32 mask;
-
 
1500
};
-
 
1501
 
-
 
1502
#define I915_MAX_WA_REGS 16
-
 
1503
 
-
 
1504
struct i915_workarounds {
-
 
1505
	struct i915_wa_reg reg[I915_MAX_WA_REGS];
-
 
1506
	u32 count;
-
 
1507
};
1395
 
1508
 
1396
struct drm_i915_private {
1509
struct drm_i915_private {
Line 1397... Line 1510...
1397
	struct drm_device *dev;
1510
	struct drm_device *dev;
Line 1424... Line 1537...
1424
	struct pci_dev *bridge_dev;
1537
	struct pci_dev *bridge_dev;
1425
	struct intel_engine_cs ring[I915_NUM_RINGS];
1538
	struct intel_engine_cs ring[I915_NUM_RINGS];
1426
	struct drm_i915_gem_object *semaphore_obj;
1539
	struct drm_i915_gem_object *semaphore_obj;
1427
	uint32_t last_seqno, next_seqno;
1540
	uint32_t last_seqno, next_seqno;
Line 1428... Line 1541...
1428
 
1541
 
1429
	drm_dma_handle_t *status_page_dmah;
1542
	struct drm_dma_handle *status_page_dmah;
Line 1430... Line 1543...
1430
	struct resource mch_res;
1543
	struct resource mch_res;
1431
 
1544
 
Line 1469... Line 1582...
1469
	struct i915_fbc fbc;
1582
	struct i915_fbc fbc;
1470
	struct i915_drrs drrs;
1583
	struct i915_drrs drrs;
1471
	struct intel_opregion opregion;
1584
	struct intel_opregion opregion;
1472
	struct intel_vbt_data vbt;
1585
	struct intel_vbt_data vbt;
Line -... Line 1586...
-
 
1586
 
-
 
1587
	bool preserve_bios_swizzle;
1473
 
1588
 
1474
	/* overlay */
1589
	/* overlay */
Line 1475... Line 1590...
1475
	struct intel_overlay *overlay;
1590
	struct intel_overlay *overlay;
1476
 
1591
 
Line 1477... Line 1592...
1477
	/* backlight registers and fields in struct intel_panel */
1592
	/* backlight registers and fields in struct intel_panel */
1478
	spinlock_t backlight_lock;
1593
	struct mutex backlight_lock;
Line -... Line 1594...
-
 
1594
 
-
 
1595
	/* LVDS info */
-
 
1596
	bool no_aux_handshake;
1479
 
1597
 
1480
	/* LVDS info */
1598
	/* protects panel power sequencer state */
1481
	bool no_aux_handshake;
1599
	struct mutex pps_mutex;
Line 1482... Line 1600...
1482
 
1600
 
1483
	struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */
1601
	struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */
-
 
1602
	int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
Line 1484... Line 1603...
1484
	int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
1603
	int num_fence_regs; /* 8 on pre-965, 16 otherwise */
1485
	int num_fence_regs; /* 8 on pre-965, 16 otherwise */
1604
 
1486
 
1605
	unsigned int fsb_freq, mem_freq, is_ddr3;
1487
	unsigned int fsb_freq, mem_freq, is_ddr3;
1606
	unsigned int vlv_cdclk_freq;
Line 1529... Line 1648...
1529
 
1648
 
1530
	int num_shared_dpll;
1649
	int num_shared_dpll;
1531
	struct intel_shared_dpll shared_dplls[I915_NUM_PLLS];
1650
	struct intel_shared_dpll shared_dplls[I915_NUM_PLLS];
Line -... Line 1651...
-
 
1651
	int dpio_phy_iosf_port[I915_NUM_PHYS_VLV];
-
 
1652
 
1532
	int dpio_phy_iosf_port[I915_NUM_PHYS_VLV];
1653
	struct i915_workarounds workarounds;
1533
 
1654
 
1534
	/* Reclocking support */
1655
	/* Reclocking support */
1535
	bool render_reclock_avail;
1656
	bool render_reclock_avail;
1536
	bool lvds_downclock_avail;
1657
	bool lvds_downclock_avail;
Line 1564... Line 1685...
1564
	struct drm_i915_gem_object *vlv_pctx;
1685
	struct drm_i915_gem_object *vlv_pctx;
Line 1565... Line 1686...
1565
 
1686
 
1566
#ifdef CONFIG_DRM_I915_FBDEV
1687
#ifdef CONFIG_DRM_I915_FBDEV
1567
	/* list of fbdev register on this device */
1688
	/* list of fbdev register on this device */
-
 
1689
    struct intel_fbdev *fbdev;
1568
    struct intel_fbdev *fbdev;
1690
	struct work_struct fbdev_suspend_work;
Line 1569... Line -...
1569
#endif
-
 
1570
 
-
 
1571
	/*
-
 
1572
	 * The console may be contended at resume, but we don't
-
 
1573
	 * want it to block on it.
-
 
1574
	 */
-
 
1575
	struct work_struct console_resume_work;
1691
#endif
1576
 
1692
 
Line 1577... Line 1693...
1577
	struct drm_property *broadcast_rgb_property;
1693
	struct drm_property *broadcast_rgb_property;
1578
	struct drm_property *force_audio_property;
1694
	struct drm_property *force_audio_property;
Line 1596... Line 1712...
1596
		uint16_t pri_latency[5];
1712
		uint16_t pri_latency[5];
1597
		/* sprite */
1713
		/* sprite */
1598
		uint16_t spr_latency[5];
1714
		uint16_t spr_latency[5];
1599
		/* cursor */
1715
		/* cursor */
1600
		uint16_t cur_latency[5];
1716
		uint16_t cur_latency[5];
-
 
1717
		/*
-
 
1718
		 * Raw watermark memory latency values
-
 
1719
		 * for SKL for all 8 levels
-
 
1720
		 * in 1us units.
-
 
1721
		 */
-
 
1722
		uint16_t skl_latency[8];
-
 
1723
 
-
 
1724
		/*
-
 
1725
		 * The skl_wm_values structure is a bit too big for stack
-
 
1726
		 * allocation, so we keep the staging struct where we store
-
 
1727
		 * intermediate results here instead.
-
 
1728
		 */
-
 
1729
		struct skl_wm_values skl_results;
Line 1601... Line 1730...
1601
 
1730
 
-
 
1731
		/* current hardware state */
1602
		/* current hardware state */
1732
		union {
-
 
1733
		struct ilk_wm_values hw;
-
 
1734
			struct skl_wm_values skl_hw;
1603
		struct ilk_wm_values hw;
1735
		};
Line 1604... Line 1736...
1604
	} wm;
1736
	} wm;
Line 1605... Line 1737...
1605
 
1737
 
Line 1617... Line 1749...
1617
	 * userspace is waiting on the DP workqueue to run which is
1749
	 * userspace is waiting on the DP workqueue to run which is
1618
	 * blocked behind the non-DP one.
1750
	 * blocked behind the non-DP one.
1619
	 */
1751
	 */
1620
	struct workqueue_struct *dp_wq;
1752
	struct workqueue_struct *dp_wq;
Line -... Line 1753...
-
 
1753
 
-
 
1754
	uint32_t bios_vgacntr;
1621
 
1755
 
1622
	/* Old dri1 support infrastructure, beware the dragons ya fools entering
1756
	/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
-
 
1757
	struct {
1623
	 * here! */
1758
		int (*do_execbuf)(struct drm_device *dev, struct drm_file *file,
-
 
1759
				  struct intel_engine_cs *ring,
1624
	struct i915_dri1_state dri1;
1760
				  struct intel_context *ctx,
1625
	/* Old ums support infrastructure, same warning applies. */
1761
				  struct drm_i915_gem_execbuffer2 *args,
-
 
1762
				  struct list_head *vmas,
-
 
1763
				  struct drm_i915_gem_object *batch_obj,
-
 
1764
				  u64 exec_start, u32 flags);
-
 
1765
		int (*init_rings)(struct drm_device *dev);
-
 
1766
		void (*cleanup_ring)(struct intel_engine_cs *ring);
-
 
1767
		void (*stop_ring)(struct intel_engine_cs *ring);
Line 1626... Line 1768...
1626
	struct i915_ums_state ums;
1768
	} gt;
1627
 
1769
 
1628
	/*
1770
	/*
1629
	 * NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
1771
	 * NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
Line 1764... Line 1906...
1764
    /*
1906
    /*
1765
	 * Is the object to be mapped as read-only to the GPU
1907
	 * Is the object to be mapped as read-only to the GPU
1766
	 * Only honoured if hardware has relevant pte bit
1908
	 * Only honoured if hardware has relevant pte bit
1767
	 */
1909
	 */
1768
	unsigned long gt_ro:1;
1910
	unsigned long gt_ro:1;
1769
 
-
 
1770
	/*
-
 
1771
     * Is the GPU currently using a fence to access this buffer,
-
 
1772
     */
-
 
1773
    unsigned int pending_fenced_gpu_access:1;
-
 
1774
    unsigned int fenced_gpu_access:1;
-
 
1775
 
-
 
1776
	unsigned int cache_level:3;
1911
	unsigned int cache_level:3;
Line 1777... Line -...
1777
 
-
 
1778
	unsigned int has_aliasing_ppgtt_mapping:1;
-
 
1779
	unsigned int has_global_gtt_mapping:1;
1912
 
Line 1780... Line 1913...
1780
	unsigned int has_dma_mapping:1;
1913
	unsigned int has_dma_mapping:1;
Line 1781... Line 1914...
1781
 
1914
 
Line 1807... Line 1940...
1807
 
1940
 
1808
    /** User space pin count and filp owning the pin */
1941
    /** User space pin count and filp owning the pin */
1809
	unsigned long user_pin_count;
1942
	unsigned long user_pin_count;
Line -... Line 1943...
-
 
1943
    struct drm_file *pin_filp;
1810
    struct drm_file *pin_filp;
1944
 
1811
 
1945
	union {
Line 1812... Line -...
1812
    /** for phy allocated objects */
-
 
1813
	drm_dma_handle_t *phys_handle;
1946
    /** for phy allocated objects */
1814
 
1947
		struct drm_dma_handle *phys_handle;
1815
	union {
1948
 
1816
		struct i915_gem_userptr {
1949
		struct i915_gem_userptr {
1817
			uintptr_t ptr;
1950
			uintptr_t ptr;
Line 1974... Line 2107...
1974
struct drm_i915_cmd_table {
2107
struct drm_i915_cmd_table {
1975
	const struct drm_i915_cmd_descriptor *table;
2108
	const struct drm_i915_cmd_descriptor *table;
1976
	int count;
2109
	int count;
1977
};
2110
};
Line -... Line 2111...
-
 
2111
 
-
 
2112
/* Note that the (struct drm_i915_private *) cast is just to shut up gcc. */
-
 
2113
#define __I915__(p) ({ \
-
 
2114
	struct drm_i915_private *__p; \
-
 
2115
	if (__builtin_types_compatible_p(typeof(*p), struct drm_i915_private)) \
-
 
2116
		__p = (struct drm_i915_private *)p; \
-
 
2117
	else if (__builtin_types_compatible_p(typeof(*p), struct drm_device)) \
-
 
2118
		__p = to_i915((struct drm_device *)p); \
-
 
2119
	else \
-
 
2120
		BUILD_BUG(); \
-
 
2121
	__p; \
1978
 
2122
})
-
 
2123
#define INTEL_INFO(p) 	(&__I915__(p)->info)
Line 1979... Line 2124...
1979
#define INTEL_INFO(dev)	(&to_i915(dev)->info)
2124
#define INTEL_DEVID(p)	(INTEL_INFO(p)->device_id)
1980
 
2125
 
1981
#define IS_I830(dev)		((dev)->pdev->device == 0x3577)
2126
#define IS_I830(dev)		(INTEL_DEVID(dev) == 0x3577)
1982
#define IS_845G(dev)		((dev)->pdev->device == 0x2562)
2127
#define IS_845G(dev)		(INTEL_DEVID(dev) == 0x2562)
1983
#define IS_I85X(dev)		(INTEL_INFO(dev)->is_i85x)
2128
#define IS_I85X(dev)		(INTEL_INFO(dev)->is_i85x)
1984
#define IS_I865G(dev)		((dev)->pdev->device == 0x2572)
2129
#define IS_I865G(dev)		(INTEL_DEVID(dev) == 0x2572)
1985
#define IS_I915G(dev)		(INTEL_INFO(dev)->is_i915g)
2130
#define IS_I915G(dev)		(INTEL_INFO(dev)->is_i915g)
1986
#define IS_I915GM(dev)		((dev)->pdev->device == 0x2592)
2131
#define IS_I915GM(dev)		(INTEL_DEVID(dev) == 0x2592)
1987
#define IS_I945G(dev)		((dev)->pdev->device == 0x2772)
2132
#define IS_I945G(dev)		(INTEL_DEVID(dev) == 0x2772)
1988
#define IS_I945GM(dev)		(INTEL_INFO(dev)->is_i945gm)
2133
#define IS_I945GM(dev)		(INTEL_INFO(dev)->is_i945gm)
1989
#define IS_BROADWATER(dev)	(INTEL_INFO(dev)->is_broadwater)
2134
#define IS_BROADWATER(dev)	(INTEL_INFO(dev)->is_broadwater)
1990
#define IS_CRESTLINE(dev)	(INTEL_INFO(dev)->is_crestline)
2135
#define IS_CRESTLINE(dev)	(INTEL_INFO(dev)->is_crestline)
1991
#define IS_GM45(dev)		((dev)->pdev->device == 0x2A42)
2136
#define IS_GM45(dev)		(INTEL_DEVID(dev) == 0x2A42)
1992
#define IS_G4X(dev)		(INTEL_INFO(dev)->is_g4x)
2137
#define IS_G4X(dev)		(INTEL_INFO(dev)->is_g4x)
1993
#define IS_PINEVIEW_G(dev)	((dev)->pdev->device == 0xa001)
2138
#define IS_PINEVIEW_G(dev)	(INTEL_DEVID(dev) == 0xa001)
1994
#define IS_PINEVIEW_M(dev)	((dev)->pdev->device == 0xa011)
2139
#define IS_PINEVIEW_M(dev)	(INTEL_DEVID(dev) == 0xa011)
1995
#define IS_PINEVIEW(dev)	(INTEL_INFO(dev)->is_pineview)
2140
#define IS_PINEVIEW(dev)	(INTEL_INFO(dev)->is_pineview)
1996
#define IS_G33(dev)		(INTEL_INFO(dev)->is_g33)
2141
#define IS_G33(dev)		(INTEL_INFO(dev)->is_g33)
1997
#define IS_IRONLAKE_M(dev)	((dev)->pdev->device == 0x0046)
2142
#define IS_IRONLAKE_M(dev)	(INTEL_DEVID(dev) == 0x0046)
1998
#define IS_IVYBRIDGE(dev)	(INTEL_INFO(dev)->is_ivybridge)
2143
#define IS_IVYBRIDGE(dev)	(INTEL_INFO(dev)->is_ivybridge)
1999
#define IS_IVB_GT1(dev)		((dev)->pdev->device == 0x0156 || \
2144
#define IS_IVB_GT1(dev)		(INTEL_DEVID(dev) == 0x0156 || \
2000
				 (dev)->pdev->device == 0x0152 || \
2145
				 INTEL_DEVID(dev) == 0x0152 || \
2001
				 (dev)->pdev->device == 0x015a)
2146
				 INTEL_DEVID(dev) == 0x015a)
2002
#define IS_SNB_GT1(dev)		((dev)->pdev->device == 0x0102 || \
2147
#define IS_SNB_GT1(dev)		(INTEL_DEVID(dev) == 0x0102 || \
2003
				 (dev)->pdev->device == 0x0106 || \
2148
				 INTEL_DEVID(dev) == 0x0106 || \
2004
				 (dev)->pdev->device == 0x010A)
2149
				 INTEL_DEVID(dev) == 0x010A)
2005
#define IS_VALLEYVIEW(dev)	(INTEL_INFO(dev)->is_valleyview)
2150
#define IS_VALLEYVIEW(dev)	(INTEL_INFO(dev)->is_valleyview)
2006
#define IS_CHERRYVIEW(dev)	(INTEL_INFO(dev)->is_valleyview && IS_GEN8(dev))
2151
#define IS_CHERRYVIEW(dev)	(INTEL_INFO(dev)->is_valleyview && IS_GEN8(dev))
-
 
2152
#define IS_HASWELL(dev)	(INTEL_INFO(dev)->is_haswell)
2007
#define IS_HASWELL(dev)	(INTEL_INFO(dev)->is_haswell)
2153
#define IS_BROADWELL(dev)	(!INTEL_INFO(dev)->is_valleyview && IS_GEN8(dev))
2008
#define IS_BROADWELL(dev)	(!INTEL_INFO(dev)->is_valleyview && IS_GEN8(dev))
2154
#define IS_SKYLAKE(dev)	(INTEL_INFO(dev)->is_skylake)
2009
#define IS_MOBILE(dev)		(INTEL_INFO(dev)->is_mobile)
2155
#define IS_MOBILE(dev)		(INTEL_INFO(dev)->is_mobile)
2010
#define IS_HSW_EARLY_SDV(dev)	(IS_HASWELL(dev) && \
2156
#define IS_HSW_EARLY_SDV(dev)	(IS_HASWELL(dev) && \
2011
				 ((dev)->pdev->device & 0xFF00) == 0x0C00)
2157
				 (INTEL_DEVID(dev) & 0xFF00) == 0x0C00)
2012
#define IS_BDW_ULT(dev)		(IS_BROADWELL(dev) && \
2158
#define IS_BDW_ULT(dev)		(IS_BROADWELL(dev) && \
2013
				 (((dev)->pdev->device & 0xf) == 0x2  || \
2159
				 ((INTEL_DEVID(dev) & 0xf) == 0x2  || \
-
 
2160
				 (INTEL_DEVID(dev) & 0xf) == 0x6 || \
-
 
2161
				 (INTEL_DEVID(dev) & 0xf) == 0xe))
2014
				 ((dev)->pdev->device & 0xf) == 0x6 || \
2162
#define IS_BDW_GT3(dev)		(IS_BROADWELL(dev) && \
2015
				 ((dev)->pdev->device & 0xf) == 0xe))
2163
				 (INTEL_DEVID(dev) & 0x00F0) == 0x0020)
2016
#define IS_HSW_ULT(dev)		(IS_HASWELL(dev) && \
-
 
2017
				 ((dev)->pdev->device & 0xFF00) == 0x0A00)
2164
#define IS_HSW_ULT(dev)		(IS_HASWELL(dev) && \
2018
#define IS_ULT(dev)		(IS_HSW_ULT(dev) || IS_BDW_ULT(dev))
2165
				 (INTEL_DEVID(dev) & 0xFF00) == 0x0A00)
2019
#define IS_HSW_GT3(dev)		(IS_HASWELL(dev) && \
2166
#define IS_HSW_GT3(dev)		(IS_HASWELL(dev) && \
2020
				 ((dev)->pdev->device & 0x00F0) == 0x0020)
2167
				 (INTEL_DEVID(dev) & 0x00F0) == 0x0020)
2021
/* ULX machines are also considered ULT. */
2168
/* ULX machines are also considered ULT. */
2022
#define IS_HSW_ULX(dev)		((dev)->pdev->device == 0x0A0E || \
2169
#define IS_HSW_ULX(dev)		(INTEL_DEVID(dev) == 0x0A0E || \
Line 2023... Line 2170...
2023
				 (dev)->pdev->device == 0x0A1E)
2170
				 INTEL_DEVID(dev) == 0x0A1E)
2024
#define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary)
2171
#define IS_PRELIMINARY_HW(intel_info) ((intel_info)->is_preliminary)
2025
 
2172
 
Line 2034... Line 2181...
2034
#define IS_GEN4(dev)	(INTEL_INFO(dev)->gen == 4)
2181
#define IS_GEN4(dev)	(INTEL_INFO(dev)->gen == 4)
2035
#define IS_GEN5(dev)	(INTEL_INFO(dev)->gen == 5)
2182
#define IS_GEN5(dev)	(INTEL_INFO(dev)->gen == 5)
2036
#define IS_GEN6(dev)	(INTEL_INFO(dev)->gen == 6)
2183
#define IS_GEN6(dev)	(INTEL_INFO(dev)->gen == 6)
2037
#define IS_GEN7(dev)	(INTEL_INFO(dev)->gen == 7)
2184
#define IS_GEN7(dev)	(INTEL_INFO(dev)->gen == 7)
2038
#define IS_GEN8(dev)	(INTEL_INFO(dev)->gen == 8)
2185
#define IS_GEN8(dev)	(INTEL_INFO(dev)->gen == 8)
-
 
2186
#define IS_GEN9(dev)	(INTEL_INFO(dev)->gen == 9)
Line 2039... Line 2187...
2039
 
2187
 
2040
#define RENDER_RING		(1<
2188
#define RENDER_RING		(1<
2041
#define BSD_RING		(1<
2189
#define BSD_RING		(1<
2042
#define BLT_RING		(1<
2190
#define BLT_RING		(1<
Line 2046... Line 2194...
2046
#define HAS_BSD2(dev)		(INTEL_INFO(dev)->ring_mask & BSD2_RING)
2194
#define HAS_BSD2(dev)		(INTEL_INFO(dev)->ring_mask & BSD2_RING)
2047
#define HAS_BLT(dev)            (INTEL_INFO(dev)->ring_mask & BLT_RING)
2195
#define HAS_BLT(dev)            (INTEL_INFO(dev)->ring_mask & BLT_RING)
2048
#define HAS_VEBOX(dev)            (INTEL_INFO(dev)->ring_mask & VEBOX_RING)
2196
#define HAS_VEBOX(dev)            (INTEL_INFO(dev)->ring_mask & VEBOX_RING)
2049
#define HAS_LLC(dev)            (INTEL_INFO(dev)->has_llc)
2197
#define HAS_LLC(dev)            (INTEL_INFO(dev)->has_llc)
2050
#define HAS_WT(dev)		((IS_HASWELL(dev) || IS_BROADWELL(dev)) && \
2198
#define HAS_WT(dev)		((IS_HASWELL(dev) || IS_BROADWELL(dev)) && \
2051
				 to_i915(dev)->ellc_size)
2199
				 __I915__(dev)->ellc_size)
2052
#define I915_NEED_GFX_HWS(dev)	(INTEL_INFO(dev)->need_gfx_hws)
2200
#define I915_NEED_GFX_HWS(dev)	(INTEL_INFO(dev)->need_gfx_hws)
Line 2053... Line 2201...
2053
 
2201
 
2054
#define HAS_HW_CONTEXTS(dev)	(INTEL_INFO(dev)->gen >= 6)
2202
#define HAS_HW_CONTEXTS(dev)	(INTEL_INFO(dev)->gen >= 6)
2055
#define HAS_ALIASING_PPGTT(dev)	(INTEL_INFO(dev)->gen >= 6)
-
 
2056
#define HAS_PPGTT(dev)		(INTEL_INFO(dev)->gen >= 7 && !IS_GEN8(dev))
2203
#define HAS_LOGICAL_RING_CONTEXTS(dev)	(INTEL_INFO(dev)->gen >= 8)
2057
#define USES_PPGTT(dev)		intel_enable_ppgtt(dev, false)
2204
#define USES_PPGTT(dev)		(i915.enable_ppgtt)
Line 2058... Line 2205...
2058
#define USES_FULL_PPGTT(dev)	intel_enable_ppgtt(dev, true)
2205
#define USES_FULL_PPGTT(dev)	(i915.enable_ppgtt == 2)
2059
 
2206
 
Line 2060... Line 2207...
2060
#define HAS_OVERLAY(dev)		(INTEL_INFO(dev)->has_overlay)
2207
#define HAS_OVERLAY(dev)		(INTEL_INFO(dev)->has_overlay)
Line 2084... Line 2231...
2084
 
2231
 
2085
#define HAS_FW_BLC(dev) (INTEL_INFO(dev)->gen > 2)
2232
#define HAS_FW_BLC(dev) (INTEL_INFO(dev)->gen > 2)
2086
#define HAS_PIPE_CXSR(dev) (INTEL_INFO(dev)->has_pipe_cxsr)
2233
#define HAS_PIPE_CXSR(dev) (INTEL_INFO(dev)->has_pipe_cxsr)
Line 2087... Line 2234...
2087
#define HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc)
2234
#define HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc)
Line 2088... Line 2235...
2088
 
2235
 
2089
#define HAS_IPS(dev)		(IS_ULT(dev) || IS_BROADWELL(dev))
2236
#define HAS_IPS(dev)		(IS_HSW_ULT(dev) || IS_BROADWELL(dev))
2090
 
2237
 
2091
#define HAS_DDI(dev)		(INTEL_INFO(dev)->has_ddi)
2238
#define HAS_DDI(dev)		(INTEL_INFO(dev)->has_ddi)
2092
#define HAS_FPGA_DBG_UNCLAIMED(dev)	(INTEL_INFO(dev)->has_fpga_dbg)
2239
#define HAS_FPGA_DBG_UNCLAIMED(dev)	(INTEL_INFO(dev)->has_fpga_dbg)
-
 
2240
#define HAS_PSR(dev)		(IS_HASWELL(dev) || IS_BROADWELL(dev))
-
 
2241
#define HAS_RUNTIME_PM(dev)	(IS_GEN6(dev) || IS_HASWELL(dev) || \
Line 2093... Line 2242...
2093
#define HAS_PSR(dev)		(IS_HASWELL(dev) || IS_BROADWELL(dev))
2242
				 IS_BROADWELL(dev) || IS_VALLEYVIEW(dev))
2094
#define HAS_RUNTIME_PM(dev)	(IS_GEN6(dev) || IS_HASWELL(dev) || \
2243
#define HAS_RC6(dev)		(INTEL_INFO(dev)->gen >= 6)
2095
				 IS_BROADWELL(dev) || IS_VALLEYVIEW(dev))
2244
#define HAS_RC6p(dev)		(INTEL_INFO(dev)->gen == 6 || IS_IVYBRIDGE(dev))
2096
 
2245
 
2097
#define INTEL_PCH_DEVICE_ID_MASK		0xff00
2246
#define INTEL_PCH_DEVICE_ID_MASK		0xff00
2098
#define INTEL_PCH_IBX_DEVICE_ID_TYPE		0x3b00
2247
#define INTEL_PCH_IBX_DEVICE_ID_TYPE		0x3b00
-
 
2248
#define INTEL_PCH_CPT_DEVICE_ID_TYPE		0x1c00
-
 
2249
#define INTEL_PCH_PPT_DEVICE_ID_TYPE		0x1e00
Line 2099... Line 2250...
2099
#define INTEL_PCH_CPT_DEVICE_ID_TYPE		0x1c00
2250
#define INTEL_PCH_LPT_DEVICE_ID_TYPE		0x8c00
-
 
2251
#define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE		0x9c00
2100
#define INTEL_PCH_PPT_DEVICE_ID_TYPE		0x1e00
2252
#define INTEL_PCH_SPT_DEVICE_ID_TYPE		0xA100
2101
#define INTEL_PCH_LPT_DEVICE_ID_TYPE		0x8c00
2253
#define INTEL_PCH_SPT_LP_DEVICE_ID_TYPE		0x9D00
2102
#define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE		0x9c00
2254
 
2103
 
2255
#define INTEL_PCH_TYPE(dev) (__I915__(dev)->pch_type)
2104
#define INTEL_PCH_TYPE(dev) (to_i915(dev)->pch_type)
2256
#define HAS_PCH_SPT(dev) (INTEL_PCH_TYPE(dev) == PCH_SPT)
Line 2133... Line 2285...
2133
	int panel_use_ssc;
2285
	int panel_use_ssc;
2134
	int vbt_sdvo_panel_type;
2286
	int vbt_sdvo_panel_type;
2135
	int enable_rc6;
2287
	int enable_rc6;
2136
	int enable_fbc;
2288
	int enable_fbc;
2137
	int enable_ppgtt;
2289
	int enable_ppgtt;
-
 
2290
	int enable_execlists;
2138
	int enable_psr;
2291
	int enable_psr;
2139
	unsigned int preliminary_hw_support;
2292
	unsigned int preliminary_hw_support;
2140
	int disable_power_well;
2293
	int disable_power_well;
2141
	int enable_ips;
2294
	int enable_ips;
2142
	int invert_brightness;
2295
	int invert_brightness;
Line 2152... Line 2305...
2152
	bool mmio_debug;
2305
	bool mmio_debug;
2153
};
2306
};
2154
extern struct i915_params i915 __read_mostly;
2307
extern struct i915_params i915 __read_mostly;
Line 2155... Line 2308...
2155
 
2308
 
2156
				/* i915_dma.c */
-
 
2157
void i915_update_dri1_breadcrumb(struct drm_device *dev);
-
 
2158
extern void i915_kernel_lost_context(struct drm_device * dev);
2309
				/* i915_dma.c */
2159
extern int i915_driver_load(struct drm_device *, unsigned long flags);
2310
extern int i915_driver_load(struct drm_device *, unsigned long flags);
2160
extern int i915_driver_unload(struct drm_device *);
2311
extern int i915_driver_unload(struct drm_device *);
2161
extern int i915_driver_open(struct drm_device *dev, struct drm_file *file);
2312
extern int i915_driver_open(struct drm_device *dev, struct drm_file *file);
2162
extern void i915_driver_lastclose(struct drm_device * dev);
2313
extern void i915_driver_lastclose(struct drm_device * dev);
Line 2167... Line 2318...
2167
extern int i915_driver_device_is_agp(struct drm_device * dev);
2318
extern int i915_driver_device_is_agp(struct drm_device * dev);
2168
#ifdef CONFIG_COMPAT
2319
#ifdef CONFIG_COMPAT
2169
extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
2320
extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
2170
			      unsigned long arg);
2321
			      unsigned long arg);
2171
#endif
2322
#endif
2172
extern int i915_emit_box(struct drm_device *dev,
-
 
2173
			 struct drm_clip_rect *box,
-
 
2174
			 int DR1, int DR4);
-
 
2175
extern int intel_gpu_reset(struct drm_device *dev);
2323
extern int intel_gpu_reset(struct drm_device *dev);
2176
extern int i915_reset(struct drm_device *dev);
2324
extern int i915_reset(struct drm_device *dev);
2177
extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
2325
extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
2178
extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
2326
extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
2179
extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv);
2327
extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv);
2180
extern void i915_update_gfx_val(struct drm_i915_private *dev_priv);
2328
extern void i915_update_gfx_val(struct drm_i915_private *dev_priv);
2181
int vlv_force_gfx_clock(struct drm_i915_private *dev_priv, bool on);
2329
int vlv_force_gfx_clock(struct drm_i915_private *dev_priv, bool on);
2182
void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
2330
void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
Line 2183... Line -...
2183
 
-
 
2184
extern void intel_console_resume(struct work_struct *work);
-
 
2185
 
2331
 
2186
/* i915_irq.c */
2332
/* i915_irq.c */
2187
void i915_queue_hangcheck(struct drm_device *dev);
2333
void i915_queue_hangcheck(struct drm_device *dev);
2188
__printf(3, 4)
2334
__printf(3, 4)
2189
void i915_handle_error(struct drm_device *dev, bool wedged,
2335
void i915_handle_error(struct drm_device *dev, bool wedged,
Line 2190... Line 2336...
2190
		       const char *fmt, ...);
2336
		       const char *fmt, ...);
2191
 
2337
 
2192
void gen6_set_pm_mask(struct drm_i915_private *dev_priv, u32 pm_iir,
2338
extern void intel_irq_init(struct drm_i915_private *dev_priv);
2193
							int new_delay);
2339
extern void intel_hpd_init(struct drm_i915_private *dev_priv);
Line 2194... Line 2340...
2194
extern void intel_irq_init(struct drm_device *dev);
2340
int intel_irq_install(struct drm_i915_private *dev_priv);
2195
extern void intel_hpd_init(struct drm_device *dev);
2341
void intel_irq_uninstall(struct drm_i915_private *dev_priv);
2196
 
2342
 
2197
extern void intel_uncore_sanitize(struct drm_device *dev);
2343
extern void intel_uncore_sanitize(struct drm_device *dev);
Line 2210... Line 2356...
2210
i915_disable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
2356
i915_disable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,
2211
		      u32 status_mask);
2357
		      u32 status_mask);
Line 2212... Line 2358...
2212
 
2358
 
2213
void valleyview_enable_display_irqs(struct drm_i915_private *dev_priv);
2359
void valleyview_enable_display_irqs(struct drm_i915_private *dev_priv);
-
 
2360
void valleyview_disable_display_irqs(struct drm_i915_private *dev_priv);
-
 
2361
void
-
 
2362
ironlake_enable_display_irq(struct drm_i915_private *dev_priv, u32 mask);
-
 
2363
void
-
 
2364
ironlake_disable_display_irq(struct drm_i915_private *dev_priv, u32 mask);
-
 
2365
void ibx_display_interrupt_update(struct drm_i915_private *dev_priv,
-
 
2366
				  uint32_t interrupt_mask,
-
 
2367
				  uint32_t enabled_irq_mask);
-
 
2368
#define ibx_enable_display_interrupt(dev_priv, bits) \
-
 
2369
	ibx_display_interrupt_update((dev_priv), (bits), (bits))
-
 
2370
#define ibx_disable_display_interrupt(dev_priv, bits) \
Line 2214... Line 2371...
2214
void valleyview_disable_display_irqs(struct drm_i915_private *dev_priv);
2371
	ibx_display_interrupt_update((dev_priv), (bits), 0)
2215
 
-
 
2216
/* i915_gem.c */
-
 
2217
int i915_gem_init_ioctl(struct drm_device *dev, void *data,
2372
 
2218
			struct drm_file *file_priv);
2373
/* i915_gem.c */
2219
int i915_gem_create_ioctl(struct drm_device *dev, void *data,
2374
int i915_gem_create_ioctl(struct drm_device *dev, void *data,
2220
			  struct drm_file *file_priv);
2375
			  struct drm_file *file_priv);
2221
int i915_gem_pread_ioctl(struct drm_device *dev, void *data,
2376
int i915_gem_pread_ioctl(struct drm_device *dev, void *data,
Line 2228... Line 2383...
2228
			struct drm_file *file_priv);
2383
			struct drm_file *file_priv);
2229
int i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
2384
int i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
2230
			      struct drm_file *file_priv);
2385
			      struct drm_file *file_priv);
2231
int i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
2386
int i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
2232
			     struct drm_file *file_priv);
2387
			     struct drm_file *file_priv);
-
 
2388
void i915_gem_execbuffer_move_to_active(struct list_head *vmas,
-
 
2389
					struct intel_engine_cs *ring);
-
 
2390
void i915_gem_execbuffer_retire_commands(struct drm_device *dev,
-
 
2391
					 struct drm_file *file,
-
 
2392
					 struct intel_engine_cs *ring,
-
 
2393
					 struct drm_i915_gem_object *obj);
-
 
2394
int i915_gem_ringbuffer_submission(struct drm_device *dev,
-
 
2395
				   struct drm_file *file,
-
 
2396
				   struct intel_engine_cs *ring,
-
 
2397
				   struct intel_context *ctx,
-
 
2398
				   struct drm_i915_gem_execbuffer2 *args,
-
 
2399
				   struct list_head *vmas,
-
 
2400
				   struct drm_i915_gem_object *batch_obj,
-
 
2401
				   u64 exec_start, u32 flags);
2233
int i915_gem_execbuffer(struct drm_device *dev, void *data,
2402
int i915_gem_execbuffer(struct drm_device *dev, void *data,
2234
			struct drm_file *file_priv);
2403
			struct drm_file *file_priv);
2235
int i915_gem_execbuffer2(struct drm_device *dev, void *data,
2404
int i915_gem_execbuffer2(struct drm_device *dev, void *data,
2236
			 struct drm_file *file_priv);
2405
			 struct drm_file *file_priv);
2237
int i915_gem_pin_ioctl(struct drm_device *dev, void *data,
2406
int i915_gem_pin_ioctl(struct drm_device *dev, void *data,
Line 2246... Line 2415...
2246
			       struct drm_file *file);
2415
			       struct drm_file *file);
2247
int i915_gem_throttle_ioctl(struct drm_device *dev, void *data,
2416
int i915_gem_throttle_ioctl(struct drm_device *dev, void *data,
2248
			    struct drm_file *file_priv);
2417
			    struct drm_file *file_priv);
2249
int i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
2418
int i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
2250
			   struct drm_file *file_priv);
2419
			   struct drm_file *file_priv);
2251
int i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
-
 
2252
			   struct drm_file *file_priv);
-
 
2253
int i915_gem_leavevt_ioctl(struct drm_device *dev, void *data,
-
 
2254
			   struct drm_file *file_priv);
-
 
2255
int i915_gem_set_tiling(struct drm_device *dev, void *data,
2420
int i915_gem_set_tiling(struct drm_device *dev, void *data,
2256
			struct drm_file *file_priv);
2421
			struct drm_file *file_priv);
2257
int i915_gem_get_tiling(struct drm_device *dev, void *data,
2422
int i915_gem_get_tiling(struct drm_device *dev, void *data,
2258
			struct drm_file *file_priv);
2423
			struct drm_file *file_priv);
2259
int i915_gem_init_userptr(struct drm_device *dev);
2424
int i915_gem_init_userptr(struct drm_device *dev);
Line 2262... Line 2427...
2262
int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
2427
int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
2263
				struct drm_file *file_priv);
2428
				struct drm_file *file_priv);
2264
int i915_gem_wait_ioctl(struct drm_device *dev, void *data,
2429
int i915_gem_wait_ioctl(struct drm_device *dev, void *data,
2265
			struct drm_file *file_priv);
2430
			struct drm_file *file_priv);
2266
void i915_gem_load(struct drm_device *dev);
2431
void i915_gem_load(struct drm_device *dev);
-
 
2432
unsigned long i915_gem_shrink(struct drm_i915_private *dev_priv,
-
 
2433
			      long target,
-
 
2434
			      unsigned flags);
-
 
2435
#define I915_SHRINK_PURGEABLE 0x1
-
 
2436
#define I915_SHRINK_UNBOUND 0x2
-
 
2437
#define I915_SHRINK_BOUND 0x4
2267
void *i915_gem_object_alloc(struct drm_device *dev);
2438
void *i915_gem_object_alloc(struct drm_device *dev);
2268
void i915_gem_object_free(struct drm_i915_gem_object *obj);
2439
void i915_gem_object_free(struct drm_i915_gem_object *obj);
2269
void i915_gem_object_init(struct drm_i915_gem_object *obj,
2440
void i915_gem_object_init(struct drm_i915_gem_object *obj,
2270
			 const struct drm_i915_gem_object_ops *ops);
2441
			 const struct drm_i915_gem_object_ops *ops);
2271
struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
2442
struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
Line 2286... Line 2457...
2286
				     uint64_t flags);
2457
				     uint64_t flags);
2287
int __must_check i915_vma_unbind(struct i915_vma *vma);
2458
int __must_check i915_vma_unbind(struct i915_vma *vma);
2288
int i915_gem_object_put_pages(struct drm_i915_gem_object *obj);
2459
int i915_gem_object_put_pages(struct drm_i915_gem_object *obj);
2289
void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv);
2460
void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv);
2290
void i915_gem_release_mmap(struct drm_i915_gem_object *obj);
2461
void i915_gem_release_mmap(struct drm_i915_gem_object *obj);
2291
void i915_gem_lastclose(struct drm_device *dev);
-
 
Line 2292... Line 2462...
2292
 
2462
 
2293
int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
2463
int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
Line 2294... Line 2464...
2294
				    int *needs_clflush);
2464
				    int *needs_clflush);
Line 2380... Line 2550...
2380
 
2550
 
2381
void i915_gem_reset(struct drm_device *dev);
2551
void i915_gem_reset(struct drm_device *dev);
2382
bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force);
2552
bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force);
2383
int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj);
2553
int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj);
-
 
2554
int __must_check i915_gem_init(struct drm_device *dev);
2384
int __must_check i915_gem_init(struct drm_device *dev);
2555
int i915_gem_init_rings(struct drm_device *dev);
2385
int __must_check i915_gem_init_hw(struct drm_device *dev);
2556
int __must_check i915_gem_init_hw(struct drm_device *dev);
2386
int i915_gem_l3_remap(struct intel_engine_cs *ring, int slice);
2557
int i915_gem_l3_remap(struct intel_engine_cs *ring, int slice);
2387
void i915_gem_init_swizzling(struct drm_device *dev);
2558
void i915_gem_init_swizzling(struct drm_device *dev);
2388
void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
2559
void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
Line 2392... Line 2563...
2392
				  struct drm_file *file,
2563
				  struct drm_file *file,
2393
		       struct drm_i915_gem_object *batch_obj,
2564
		       struct drm_i915_gem_object *batch_obj,
2394
		     u32 *seqno);
2565
		     u32 *seqno);
2395
#define i915_add_request(ring, seqno) \
2566
#define i915_add_request(ring, seqno) \
2396
	__i915_add_request(ring, NULL, NULL, seqno)
2567
	__i915_add_request(ring, NULL, NULL, seqno)
-
 
2568
int __i915_wait_seqno(struct intel_engine_cs *ring, u32 seqno,
-
 
2569
			unsigned reset_counter,
-
 
2570
			bool interruptible,
-
 
2571
			s64 *timeout,
-
 
2572
			struct drm_i915_file_private *file_priv);
2397
int __must_check i915_wait_seqno(struct intel_engine_cs *ring,
2573
int __must_check i915_wait_seqno(struct intel_engine_cs *ring,
2398
				   uint32_t seqno);
2574
				   uint32_t seqno);
2399
int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
2575
int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
2400
int __must_check
2576
int __must_check
2401
i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj,
2577
i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj,
Line 2450... Line 2626...
2450
			return true;
2626
			return true;
2451
	return false;
2627
	return false;
2452
}
2628
}
Line 2453... Line 2629...
2453
 
2629
 
2454
/* Some GGTT VM helpers */
2630
/* Some GGTT VM helpers */
2455
#define obj_to_ggtt(obj) \
2631
#define i915_obj_to_ggtt(obj) \
2456
	(&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base)
2632
	(&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base)
2457
static inline bool i915_is_ggtt(struct i915_address_space *vm)
2633
static inline bool i915_is_ggtt(struct i915_address_space *vm)
2458
{
2634
{
2459
	struct i915_address_space *ggtt =
2635
	struct i915_address_space *ggtt =
2460
		&((struct drm_i915_private *)(vm)->dev->dev_private)->gtt.base;
2636
		&((struct drm_i915_private *)(vm)->dev->dev_private)->gtt.base;
2461
	return vm == ggtt;
2637
	return vm == ggtt;
Line -... Line 2638...
-
 
2638
}
-
 
2639
 
-
 
2640
static inline struct i915_hw_ppgtt *
-
 
2641
i915_vm_to_ppgtt(struct i915_address_space *vm)
-
 
2642
{
-
 
2643
	WARN_ON(i915_is_ggtt(vm));
-
 
2644
 
-
 
2645
	return container_of(vm, struct i915_hw_ppgtt, base);
-
 
2646
}
2462
}
2647
 
2463
 
2648
 
2464
static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)
2649
static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj)
2465
{
2650
{
Line 2466... Line 2651...
2466
	return i915_gem_obj_bound(obj, obj_to_ggtt(obj));
2651
	return i915_gem_obj_bound(obj, i915_obj_to_ggtt(obj));
2467
}
2652
}
2468
 
2653
 
2469
static inline unsigned long
2654
static inline unsigned long
2470
i915_gem_obj_ggtt_offset(struct drm_i915_gem_object *obj)
2655
i915_gem_obj_ggtt_offset(struct drm_i915_gem_object *obj)
Line 2471... Line 2656...
2471
{
2656
{
2472
	return i915_gem_obj_offset(obj, obj_to_ggtt(obj));
2657
	return i915_gem_obj_offset(obj, i915_obj_to_ggtt(obj));
2473
}
2658
}
2474
 
2659
 
2475
static inline unsigned long
2660
static inline unsigned long
Line 2476... Line 2661...
2476
i915_gem_obj_ggtt_size(struct drm_i915_gem_object *obj)
2661
i915_gem_obj_ggtt_size(struct drm_i915_gem_object *obj)
2477
{
2662
{
2478
	return i915_gem_obj_size(obj, obj_to_ggtt(obj));
2663
	return i915_gem_obj_size(obj, i915_obj_to_ggtt(obj));
2479
}
2664
}
2480
 
2665
 
2481
static inline int __must_check
2666
static inline int __must_check
-
 
2667
i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,
2482
i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,
2668
		      uint32_t alignment,
Line 2483... Line 2669...
2483
		      uint32_t alignment,
2669
		      unsigned flags)
2484
		      unsigned flags)
2670
{
2485
{
2671
	return i915_gem_object_pin(obj, i915_obj_to_ggtt(obj),
Line 2493... Line 2679...
2493
}
2679
}
Line 2494... Line 2680...
2494
 
2680
 
Line 2495... Line 2681...
2495
void i915_gem_object_ggtt_unpin(struct drm_i915_gem_object *obj);
2681
void i915_gem_object_ggtt_unpin(struct drm_i915_gem_object *obj);
2496
 
-
 
2497
/* i915_gem_context.c */
2682
 
2498
#define ctx_to_ppgtt(ctx) container_of((ctx)->vm, struct i915_hw_ppgtt, base)
2683
/* i915_gem_context.c */
2499
int __must_check i915_gem_context_init(struct drm_device *dev);
2684
int __must_check i915_gem_context_init(struct drm_device *dev);
2500
void i915_gem_context_fini(struct drm_device *dev);
2685
void i915_gem_context_fini(struct drm_device *dev);
2501
void i915_gem_context_reset(struct drm_device *dev);
2686
void i915_gem_context_reset(struct drm_device *dev);
Line 2505... Line 2690...
2505
int i915_switch_context(struct intel_engine_cs *ring,
2690
int i915_switch_context(struct intel_engine_cs *ring,
2506
			struct intel_context *to);
2691
			struct intel_context *to);
2507
struct intel_context *
2692
struct intel_context *
2508
i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id);
2693
i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id);
2509
void i915_gem_context_free(struct kref *ctx_ref);
2694
void i915_gem_context_free(struct kref *ctx_ref);
-
 
2695
struct drm_i915_gem_object *
-
 
2696
i915_gem_alloc_context_obj(struct drm_device *dev, size_t size);
2510
static inline void i915_gem_context_reference(struct intel_context *ctx)
2697
static inline void i915_gem_context_reference(struct intel_context *ctx)
2511
{
2698
{
2512
	kref_get(&ctx->ref);
2699
	kref_get(&ctx->ref);
2513
}
2700
}
Line 2525... Line 2712...
2525
int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
2712
int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
2526
				  struct drm_file *file);
2713
				  struct drm_file *file);
2527
int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
2714
int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
2528
				   struct drm_file *file);
2715
				   struct drm_file *file);
Line 2529... Line -...
2529
 
-
 
2530
/* i915_gem_render_state.c */
-
 
2531
int i915_gem_render_state_init(struct intel_engine_cs *ring);
2716
 
2532
/* i915_gem_evict.c */
2717
/* i915_gem_evict.c */
2533
int __must_check i915_gem_evict_something(struct drm_device *dev,
2718
int __must_check i915_gem_evict_something(struct drm_device *dev,
2534
					  struct i915_address_space *vm,
2719
					  struct i915_address_space *vm,
2535
					  int min_size,
2720
					  int min_size,
Line 2594... Line 2779...
2594
__printf(2, 3)
2779
__printf(2, 3)
2595
void i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...);
2780
void i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...);
2596
int i915_error_state_to_str(struct drm_i915_error_state_buf *estr,
2781
int i915_error_state_to_str(struct drm_i915_error_state_buf *estr,
2597
			    const struct i915_error_state_file_priv *error);
2782
			    const struct i915_error_state_file_priv *error);
2598
int i915_error_state_buf_init(struct drm_i915_error_state_buf *eb,
2783
int i915_error_state_buf_init(struct drm_i915_error_state_buf *eb,
-
 
2784
			      struct drm_i915_private *i915,
2599
			      size_t count, loff_t pos);
2785
			      size_t count, loff_t pos);
2600
static inline void i915_error_state_buf_release(
2786
static inline void i915_error_state_buf_release(
2601
	struct drm_i915_error_state_buf *eb)
2787
	struct drm_i915_error_state_buf *eb)
2602
{
2788
{
2603
	kfree(eb->buf);
2789
	kfree(eb->buf);
Line 2608... Line 2794...
2608
			  struct i915_error_state_file_priv *error_priv);
2794
			  struct i915_error_state_file_priv *error_priv);
2609
void i915_error_state_put(struct i915_error_state_file_priv *error_priv);
2795
void i915_error_state_put(struct i915_error_state_file_priv *error_priv);
2610
void i915_destroy_error_state(struct drm_device *dev);
2796
void i915_destroy_error_state(struct drm_device *dev);
Line 2611... Line 2797...
2611
 
2797
 
2612
void i915_get_extra_instdone(struct drm_device *dev, uint32_t *instdone);
2798
void i915_get_extra_instdone(struct drm_device *dev, uint32_t *instdone);
Line 2613... Line 2799...
2613
const char *i915_cache_level_str(int type);
2799
const char *i915_cache_level_str(struct drm_i915_private *i915, int type);
2614
 
2800
 
2615
/* i915_cmd_parser.c */
2801
/* i915_cmd_parser.c */
2616
int i915_cmd_parser_get_version(void);
2802
int i915_cmd_parser_get_version(void);
Line 2651... Line 2837...
2651
	return container_of(adapter, struct intel_gmbus, adapter)->force_bit;
2837
	return container_of(adapter, struct intel_gmbus, adapter)->force_bit;
2652
}
2838
}
2653
extern void intel_i2c_reset(struct drm_device *dev);
2839
extern void intel_i2c_reset(struct drm_device *dev);
Line 2654... Line 2840...
2654
 
2840
 
2655
/* intel_opregion.c */
-
 
2656
struct intel_encoder;
2841
/* intel_opregion.c */
2657
#ifdef CONFIG_ACPI
2842
#ifdef CONFIG_ACPI
2658
extern int intel_opregion_setup(struct drm_device *dev);
2843
extern int intel_opregion_setup(struct drm_device *dev);
2659
extern void intel_opregion_init(struct drm_device *dev);
2844
extern void intel_opregion_init(struct drm_device *dev);
2660
extern void intel_opregion_fini(struct drm_device *dev);
2845
extern void intel_opregion_fini(struct drm_device *dev);
Line 2689... Line 2874...
2689
static inline void intel_unregister_dsm_handler(void) { return; }
2874
static inline void intel_unregister_dsm_handler(void) { return; }
2690
#endif /* CONFIG_ACPI */
2875
#endif /* CONFIG_ACPI */
Line 2691... Line 2876...
2691
 
2876
 
2692
/* modesetting */
2877
/* modesetting */
2693
extern void intel_modeset_init_hw(struct drm_device *dev);
-
 
2694
extern void intel_modeset_suspend_hw(struct drm_device *dev);
2878
extern void intel_modeset_init_hw(struct drm_device *dev);
2695
extern void intel_modeset_init(struct drm_device *dev);
2879
extern void intel_modeset_init(struct drm_device *dev);
2696
extern void intel_modeset_gem_init(struct drm_device *dev);
2880
extern void intel_modeset_gem_init(struct drm_device *dev);
2697
extern void intel_modeset_cleanup(struct drm_device *dev);
2881
extern void intel_modeset_cleanup(struct drm_device *dev);
2698
extern void intel_connector_unregister(struct intel_connector *);
2882
extern void intel_connector_unregister(struct intel_connector *);
2699
extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
2883
extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
2700
extern void intel_modeset_setup_hw_state(struct drm_device *dev,
2884
extern void intel_modeset_setup_hw_state(struct drm_device *dev,
2701
					 bool force_restore);
2885
					 bool force_restore);
2702
extern void i915_redisable_vga(struct drm_device *dev);
2886
extern void i915_redisable_vga(struct drm_device *dev);
2703
extern void i915_redisable_vga_power_on(struct drm_device *dev);
2887
extern void i915_redisable_vga_power_on(struct drm_device *dev);
-
 
2888
extern bool intel_fbc_enabled(struct drm_device *dev);
2704
extern bool intel_fbc_enabled(struct drm_device *dev);
2889
extern void bdw_fbc_sw_flush(struct drm_device *dev, u32 value);
2705
extern void intel_disable_fbc(struct drm_device *dev);
2890
extern void intel_disable_fbc(struct drm_device *dev);
2706
extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
2891
extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
2707
extern void intel_init_pch_refclk(struct drm_device *dev);
2892
extern void intel_init_pch_refclk(struct drm_device *dev);
2708
extern void gen6_set_rps(struct drm_device *dev, u8 val);
2893
extern void gen6_set_rps(struct drm_device *dev, u8 val);
Line 2739... Line 2924...
2739
 */
2924
 */
2740
void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine);
2925
void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine);
2741
void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine);
2926
void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine);
2742
void assert_force_wake_inactive(struct drm_i915_private *dev_priv);
2927
void assert_force_wake_inactive(struct drm_i915_private *dev_priv);
Line 2743... Line 2928...
2743
 
2928
 
2744
int sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val);
2929
int sandybridge_pcode_read(struct drm_i915_private *dev_priv, u32 mbox, u32 *val);
Line 2745... Line 2930...
2745
int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val);
2930
int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u32 mbox, u32 val);
2746
 
2931
 
2747
/* intel_sideband.c */
2932
/* intel_sideband.c */
2748
u32 vlv_punit_read(struct drm_i915_private *dev_priv, u8 addr);
2933
u32 vlv_punit_read(struct drm_i915_private *dev_priv, u8 addr);
Line 2770... Line 2955...
2770
int vlv_gpu_freq(struct drm_i915_private *dev_priv, int val);
2955
int vlv_gpu_freq(struct drm_i915_private *dev_priv, int val);
2771
int vlv_freq_opcode(struct drm_i915_private *dev_priv, int val);
2956
int vlv_freq_opcode(struct drm_i915_private *dev_priv, int val);
Line 2772... Line 2957...
2772
 
2957
 
2773
#define FORCEWAKE_RENDER	(1 << 0)
2958
#define FORCEWAKE_RENDER	(1 << 0)
-
 
2959
#define FORCEWAKE_MEDIA		(1 << 1)
2774
#define FORCEWAKE_MEDIA		(1 << 1)
2960
#define FORCEWAKE_BLITTER	(1 << 2)
-
 
2961
#define FORCEWAKE_ALL		(FORCEWAKE_RENDER | FORCEWAKE_MEDIA | \
Line 2775... Line 2962...
2775
#define FORCEWAKE_ALL		(FORCEWAKE_RENDER | FORCEWAKE_MEDIA)
2962
					FORCEWAKE_BLITTER)
2776
 
2963
 
Line 2836... Line 3023...
2836
	unsigned long j = msecs_to_jiffies(m);
3023
	unsigned long j = msecs_to_jiffies(m);
Line 2837... Line 3024...
2837
 
3024
 
2838
	return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1);
3025
	return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1);
Line -... Line 3026...
-
 
3026
}
-
 
3027
 
-
 
3028
static inline unsigned long nsecs_to_jiffies_timeout(const u64 n)
-
 
3029
{
-
 
3030
        return min_t(u64, MAX_JIFFY_OFFSET, nsecs_to_jiffies64(n) + 1);
2839
}
3031
}
2840
 
3032
 
2841
static inline unsigned long
3033
static inline unsigned long
2842
timespec_to_jiffies_timeout(const struct timespec *value)
3034
timespec_to_jiffies_timeout(const struct timespec *value)
Line 2903... Line 3095...
2903
};
3095
};
Line 2904... Line 3096...
2904
 
3096
 
Line -... Line 3097...
-
 
3097
#define ioread32(addr)          readl(addr)
-
 
3098
 
-
 
3099
 
-
 
3100
static inline int pm_runtime_get_sync(struct device *dev)
-
 
3101
{
-
 
3102
    return 0;
-
 
3103
}
-
 
3104
 
-
 
3105
static inline int pm_runtime_set_active(struct device *dev)
-
 
3106
{
-
 
3107
    return 0;
-
 
3108
}
-
 
3109
 
-
 
3110
static inline void pm_runtime_disable(struct device *dev)
-
 
3111
{
-
 
3112
 
-
 
3113
}
-
 
3114
 
-
 
3115
static inline int pm_runtime_put_autosuspend(struct device *dev)
-
 
3116
{
-
 
3117
    return 0;
-
 
3118
}
-
 
3119
 
-
 
3120
static inline u8 inb(u16 port)
-
 
3121
{
-
 
3122
        u8 v;
-
 
3123
        asm volatile("inb %1,%0" : "=a" (v) : "dN" (port));
-
 
3124
        return v;
-
 
3125
}
-
 
3126
 
-
 
3127
static inline void outb(u8 v, u16 port)
-
 
3128
{
2905
#define ioread32(addr)          readl(addr)
3129
        asm volatile("outb %0,%1" : : "a" (v), "dN" (port));