i915_drv.c (277487) | i915_drv.c (278146) |
---|---|
1/* i915_drv.c -- Intel i915 driver -*- linux-c -*- 2 * Created: Wed Feb 14 17:10:04 2001 by gareth@valinux.com 3 */ 4/*- 5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 6 * All Rights Reserved. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a --- 16 unchanged lines hidden (view full) --- 25 * OTHER DEALINGS IN THE SOFTWARE. 26 * 27 * Authors: 28 * Gareth Hughes <gareth@valinux.com> 29 * 30 */ 31 32#include <sys/cdefs.h> | 1/* i915_drv.c -- Intel i915 driver -*- linux-c -*- 2 * Created: Wed Feb 14 17:10:04 2001 by gareth@valinux.com 3 */ 4/*- 5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 6 * All Rights Reserved. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a --- 16 unchanged lines hidden (view full) --- 25 * OTHER DEALINGS IN THE SOFTWARE. 26 * 27 * Authors: 28 * Gareth Hughes <gareth@valinux.com> 29 * 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/drm2/i915/i915_drv.c 277487 2015-01-21 16:10:37Z kib $"); | 33__FBSDID("$FreeBSD: head/sys/dev/drm2/i915/i915_drv.c 278146 2015-02-03 10:30:41Z kib $"); |
34 35#include <dev/drm2/drmP.h> 36#include <dev/drm2/drm.h> 37#include <dev/drm2/drm_mm.h> 38#include <dev/drm2/i915/i915_drm.h> 39#include <dev/drm2/i915/i915_drv.h> 40#include <dev/drm2/drm_pciids.h> 41#include <dev/drm2/i915/intel_drv.h> --- 161 unchanged lines hidden (view full) --- 203 204static const struct intel_device_info intel_haswell_d_info = { 205 .is_haswell = 1, .gen = 7, 206 .need_gfx_hws = 1, .has_hotplug = 1, 207 .has_bsd_ring = 1, 208 .has_blt_ring = 1, 209 .has_llc = 1, 210 .has_pch_split = 1, | 34 35#include <dev/drm2/drmP.h> 36#include <dev/drm2/drm.h> 37#include <dev/drm2/drm_mm.h> 38#include <dev/drm2/i915/i915_drm.h> 39#include <dev/drm2/i915/i915_drv.h> 40#include <dev/drm2/drm_pciids.h> 41#include <dev/drm2/i915/intel_drv.h> --- 161 unchanged lines hidden (view full) --- 203 204static const struct intel_device_info intel_haswell_d_info = { 205 .is_haswell = 1, .gen = 7, 206 .need_gfx_hws = 1, .has_hotplug = 1, 207 .has_bsd_ring = 1, 208 .has_blt_ring = 1, 209 .has_llc = 1, 210 .has_pch_split = 1, |
211 .not_supported = 1, |
|
211}; 212 213static const struct intel_device_info intel_haswell_m_info = { 214 .is_haswell = 1, .gen = 7, .is_mobile = 1, 215 .need_gfx_hws = 1, .has_hotplug = 1, 216 .has_bsd_ring = 1, 217 .has_blt_ring = 1, 218 .has_llc = 1, 219 .has_pch_split = 1, | 212}; 213 214static const struct intel_device_info intel_haswell_m_info = { 215 .is_haswell = 1, .gen = 7, .is_mobile = 1, 216 .need_gfx_hws = 1, .has_hotplug = 1, 217 .has_bsd_ring = 1, 218 .has_blt_ring = 1, 219 .has_llc = 1, 220 .has_pch_split = 1, |
221 .not_supported = 1, |
|
220}; 221 222#define INTEL_VGA_DEVICE(id, info_) { \ 223 .device = id, \ 224 .info = info_, \ 225} 226 227static const struct intel_gfx_device_id { --- 49 unchanged lines hidden (view full) --- 277 INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ 278 INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ 279 INTEL_VGA_DEVICE(0x0406, &intel_haswell_m_info), /* GT1 mobile */ 280 INTEL_VGA_DEVICE(0x0416, &intel_haswell_m_info), /* GT2 mobile */ 281 INTEL_VGA_DEVICE(0x0c16, &intel_haswell_d_info), /* SDV */ 282 {0, 0} 283}; 284 | 222}; 223 224#define INTEL_VGA_DEVICE(id, info_) { \ 225 .device = id, \ 226 .info = info_, \ 227} 228 229static const struct intel_gfx_device_id { --- 49 unchanged lines hidden (view full) --- 279 INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ 280 INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ 281 INTEL_VGA_DEVICE(0x0406, &intel_haswell_m_info), /* GT1 mobile */ 282 INTEL_VGA_DEVICE(0x0416, &intel_haswell_m_info), /* GT2 mobile */ 283 INTEL_VGA_DEVICE(0x0c16, &intel_haswell_d_info), /* SDV */ 284 {0, 0} 285}; 286 |
287static int i915_enable_unsupported; 288 |
|
285static int i915_drm_freeze(struct drm_device *dev) 286{ 287 struct drm_i915_private *dev_priv; 288 int error; 289 290 dev_priv = dev->dev_private; 291 drm_kms_helper_poll_disable(dev); 292 --- 115 unchanged lines hidden (view full) --- 408 ret = bus_generic_resume(kdev); 409 DRM_DEBUG_KMS("finished resume %d\n", ret); 410 return (ret); 411} 412 413static int 414i915_probe(device_t kdev) 415{ | 289static int i915_drm_freeze(struct drm_device *dev) 290{ 291 struct drm_i915_private *dev_priv; 292 int error; 293 294 dev_priv = dev->dev_private; 295 drm_kms_helper_poll_disable(dev); 296 --- 115 unchanged lines hidden (view full) --- 412 ret = bus_generic_resume(kdev); 413 DRM_DEBUG_KMS("finished resume %d\n", ret); 414 return (ret); 415} 416 417static int 418i915_probe(device_t kdev) 419{ |
420 const struct intel_device_info *info; 421 int error; |
|
416 | 422 |
417 return drm_probe(kdev, i915_pciidlist); | 423 error = drm_probe(kdev, i915_pciidlist); 424 if (error != 0) 425 return (error); 426 info = i915_get_device_id(pci_get_device(kdev)); 427 if (info == NULL) 428 return (ENXIO); 429 return (0); |
418} 419 420int i915_modeset; 421 422static int 423i915_attach(device_t kdev) 424{ 425 struct drm_device *dev; --- 27 unchanged lines hidden (view full) --- 453const struct intel_device_info * 454i915_get_device_id(int device) 455{ 456 const struct intel_gfx_device_id *did; 457 458 for (did = &pciidlist[0]; did->device != 0; did++) { 459 if (did->device != device) 460 continue; | 430} 431 432int i915_modeset; 433 434static int 435i915_attach(device_t kdev) 436{ 437 struct drm_device *dev; --- 27 unchanged lines hidden (view full) --- 465const struct intel_device_info * 466i915_get_device_id(int device) 467{ 468 const struct intel_gfx_device_id *did; 469 470 for (did = &pciidlist[0]; did->device != 0; did++) { 471 if (did->device != device) 472 continue; |
473 if (did->info->not_supported && !i915_enable_unsupported) 474 return (NULL); |
|
461 return (did->info); 462 } 463 return (NULL); 464} 465 466static device_method_t i915_methods[] = { 467 /* Device interface */ 468 DEVMETHOD(device_probe, i915_probe), --- 53 unchanged lines hidden (view full) --- 522int i915_panel_invert_brightness; 523TUNABLE_INT("drm.i915.panel_invert_brightness", &i915_panel_invert_brightness); 524int i915_modeset = 1; 525TUNABLE_INT("drm.i915.modeset", &i915_modeset); 526int i915_enable_ppgtt = -1; 527TUNABLE_INT("drm.i915.enable_ppgtt", &i915_enable_ppgtt); 528int i915_enable_hangcheck = 1; 529TUNABLE_INT("drm.i915.enable_hangcheck", &i915_enable_hangcheck); | 475 return (did->info); 476 } 477 return (NULL); 478} 479 480static device_method_t i915_methods[] = { 481 /* Device interface */ 482 DEVMETHOD(device_probe, i915_probe), --- 53 unchanged lines hidden (view full) --- 536int i915_panel_invert_brightness; 537TUNABLE_INT("drm.i915.panel_invert_brightness", &i915_panel_invert_brightness); 538int i915_modeset = 1; 539TUNABLE_INT("drm.i915.modeset", &i915_modeset); 540int i915_enable_ppgtt = -1; 541TUNABLE_INT("drm.i915.enable_ppgtt", &i915_enable_ppgtt); 542int i915_enable_hangcheck = 1; 543TUNABLE_INT("drm.i915.enable_hangcheck", &i915_enable_hangcheck); |
544TUNABLE_INT("drm.i915.enable_unsupported", &i915_enable_unsupported); |
|
530 531#define PCI_VENDOR_INTEL 0x8086 532#define INTEL_PCH_DEVICE_ID_MASK 0xff00 533#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 534#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 535#define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 536#define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 537 --- 457 unchanged lines hidden --- | 545 546#define PCI_VENDOR_INTEL 0x8086 547#define INTEL_PCH_DEVICE_ID_MASK 0xff00 548#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 549#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 550#define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 551#define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 552 --- 457 unchanged lines hidden --- |