You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'drm-intel-next-2015-02-27' of git://anongit.freedesktop.org/drm-intel into drm-next
- Y tiling support for scanout from Tvrtko&Damien - Remove more UMS support - some small prep patches for OLR removal from John Harrison - first few patches for dynamic pagetable allocation from Ben Widawsky, rebased by tons of other people - DRRS support patches (Sonika&Vandana) - fbc patches from Paulo - make sure our vblank callbacks aren't called when the pipes are off - various patches all over * tag 'drm-intel-next-2015-02-27' of git://anongit.freedesktop.org/drm-intel: (61 commits) drm/i915: Update DRIVER_DATE to 20150227 drm/i915: Clarify obj->map_and_fenceable drm/i915/skl: Allow Y (and Yf) frame buffer creation drm/i915/skl: Update watermarks for Y tiling drm/i915/skl: Updated watermark programming drm/i915/skl: Adjust get_plane_config() to support Yb/Yf tiling drm/i915/skl: Teach pin_and_fence_fb_obj() about Y tiling constraints drm/i915/skl: Adjust intel_fb_align_height() for Yb/Yf tiling drm/i915/skl: Allow scanning out Y and Yf fbs drm/i915/skl: Add new displayable tiling formats drm/i915: Remove DRIVER_MODESET checks from modeset code drm/i915: Remove regfile code&data for UMS suspend/resume drm/i915: Remove DRIVER_MODESET checks from gem code drm/i915: Remove DRIVER_MODESET checks in the gpu reset code drm/i915: Remove DRIVER_MODESET checks from suspend/resume code drm/i915: Remove DRIVER_MODESET checks in load/unload/close code drm/i915: fix a printk format drm/i915: Add media rc6 residency file to sysfs drm/i915: Add missing description to parameter in alloc_pt_range drm/i915: Removed the read of RP_STATE_CAP from sysfs/debugfs functions ...
This commit is contained in:
@@ -4051,6 +4051,17 @@ int num_ioctls;</synopsis>
|
||||
<title>Frame Buffer Compression (FBC)</title>
|
||||
!Pdrivers/gpu/drm/i915/intel_fbc.c Frame Buffer Compression (FBC)
|
||||
!Idrivers/gpu/drm/i915/intel_fbc.c
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>Display Refresh Rate Switching (DRRS)</title>
|
||||
!Pdrivers/gpu/drm/i915/intel_dp.c Display Refresh Rate Switching (DRRS)
|
||||
!Fdrivers/gpu/drm/i915/intel_dp.c intel_dp_set_drrs_state
|
||||
!Fdrivers/gpu/drm/i915/intel_dp.c intel_edp_drrs_enable
|
||||
!Fdrivers/gpu/drm/i915/intel_dp.c intel_edp_drrs_disable
|
||||
!Fdrivers/gpu/drm/i915/intel_dp.c intel_edp_drrs_invalidate
|
||||
!Fdrivers/gpu/drm/i915/intel_dp.c intel_edp_drrs_flush
|
||||
!Fdrivers/gpu/drm/i915/intel_dp.c intel_dp_drrs_init
|
||||
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>DPIO</title>
|
||||
|
||||
+46
-10
@@ -276,7 +276,6 @@ static void vblank_disable_fn(unsigned long arg)
|
||||
void drm_vblank_cleanup(struct drm_device *dev)
|
||||
{
|
||||
int crtc;
|
||||
unsigned long irqflags;
|
||||
|
||||
/* Bail if the driver didn't call drm_vblank_init() */
|
||||
if (dev->num_crtcs == 0)
|
||||
@@ -285,11 +284,10 @@ void drm_vblank_cleanup(struct drm_device *dev)
|
||||
for (crtc = 0; crtc < dev->num_crtcs; crtc++) {
|
||||
struct drm_vblank_crtc *vblank = &dev->vblank[crtc];
|
||||
|
||||
del_timer_sync(&vblank->disable_timer);
|
||||
WARN_ON(vblank->enabled &&
|
||||
drm_core_check_feature(dev, DRIVER_MODESET));
|
||||
|
||||
spin_lock_irqsave(&dev->vbl_lock, irqflags);
|
||||
vblank_disable_and_save(dev, crtc);
|
||||
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
|
||||
del_timer_sync(&vblank->disable_timer);
|
||||
}
|
||||
|
||||
kfree(dev->vblank);
|
||||
@@ -475,17 +473,23 @@ int drm_irq_uninstall(struct drm_device *dev)
|
||||
dev->irq_enabled = false;
|
||||
|
||||
/*
|
||||
* Wake up any waiters so they don't hang.
|
||||
* Wake up any waiters so they don't hang. This is just to paper over
|
||||
* isssues for UMS drivers which aren't in full control of their
|
||||
* vblank/irq handling. KMS drivers must ensure that vblanks are all
|
||||
* disabled when uninstalling the irq handler.
|
||||
*/
|
||||
if (dev->num_crtcs) {
|
||||
spin_lock_irqsave(&dev->vbl_lock, irqflags);
|
||||
for (i = 0; i < dev->num_crtcs; i++) {
|
||||
struct drm_vblank_crtc *vblank = &dev->vblank[i];
|
||||
|
||||
if (!vblank->enabled)
|
||||
continue;
|
||||
|
||||
WARN_ON(drm_core_check_feature(dev, DRIVER_MODESET));
|
||||
|
||||
vblank_disable_and_save(dev, i);
|
||||
wake_up(&vblank->queue);
|
||||
vblank->enabled = false;
|
||||
vblank->last =
|
||||
dev->driver->get_vblank_counter(dev, i);
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
|
||||
}
|
||||
@@ -1232,6 +1236,38 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
|
||||
}
|
||||
EXPORT_SYMBOL(drm_crtc_vblank_off);
|
||||
|
||||
/**
|
||||
* drm_crtc_vblank_reset - reset vblank state to off on a CRTC
|
||||
* @crtc: CRTC in question
|
||||
*
|
||||
* Drivers can use this function to reset the vblank state to off at load time.
|
||||
* Drivers should use this together with the drm_crtc_vblank_off() and
|
||||
* drm_crtc_vblank_on() functions. The difference compared to
|
||||
* drm_crtc_vblank_off() is that this function doesn't save the vblank counter
|
||||
* and hence doesn't need to call any driver hooks.
|
||||
*/
|
||||
void drm_crtc_vblank_reset(struct drm_crtc *drm_crtc)
|
||||
{
|
||||
struct drm_device *dev = drm_crtc->dev;
|
||||
unsigned long irqflags;
|
||||
int crtc = drm_crtc_index(drm_crtc);
|
||||
struct drm_vblank_crtc *vblank = &dev->vblank[crtc];
|
||||
|
||||
spin_lock_irqsave(&dev->vbl_lock, irqflags);
|
||||
/*
|
||||
* Prevent subsequent drm_vblank_get() from enabling the vblank
|
||||
* interrupt by bumping the refcount.
|
||||
*/
|
||||
if (!vblank->inmodeset) {
|
||||
atomic_inc(&vblank->refcount);
|
||||
vblank->inmodeset = 1;
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
|
||||
|
||||
WARN_ON(!list_empty(&dev->vblank_event_list));
|
||||
}
|
||||
EXPORT_SYMBOL(drm_crtc_vblank_reset);
|
||||
|
||||
/**
|
||||
* drm_vblank_on - enable vblank events on a CRTC
|
||||
* @dev: DRM device
|
||||
@@ -1653,7 +1689,7 @@ bool drm_handle_vblank(struct drm_device *dev, int crtc)
|
||||
struct timeval tvblank;
|
||||
unsigned long irqflags;
|
||||
|
||||
if (!dev->num_crtcs)
|
||||
if (WARN_ON_ONCE(!dev->num_crtcs))
|
||||
return false;
|
||||
|
||||
if (WARN_ON(crtc >= dev->num_crtcs))
|
||||
|
||||
@@ -87,8 +87,7 @@ i915-y += dvo_ch7017.o \
|
||||
i915-y += i915_vgpu.o
|
||||
|
||||
# legacy horrors
|
||||
i915-y += i915_dma.o \
|
||||
i915_ums.o
|
||||
i915-y += i915_dma.o
|
||||
|
||||
obj-$(CONFIG_DRM_I915) += i915.o
|
||||
|
||||
|
||||
@@ -818,24 +818,26 @@ static bool valid_reg(const u32 *table, int count, u32 addr)
|
||||
return false;
|
||||
}
|
||||
|
||||
static u32 *vmap_batch(struct drm_i915_gem_object *obj)
|
||||
static u32 *vmap_batch(struct drm_i915_gem_object *obj,
|
||||
unsigned start, unsigned len)
|
||||
{
|
||||
int i;
|
||||
void *addr = NULL;
|
||||
struct sg_page_iter sg_iter;
|
||||
int first_page = start >> PAGE_SHIFT;
|
||||
int last_page = (len + start + 4095) >> PAGE_SHIFT;
|
||||
int npages = last_page - first_page;
|
||||
struct page **pages;
|
||||
|
||||
pages = drm_malloc_ab(obj->base.size >> PAGE_SHIFT, sizeof(*pages));
|
||||
pages = drm_malloc_ab(npages, sizeof(*pages));
|
||||
if (pages == NULL) {
|
||||
DRM_DEBUG_DRIVER("Failed to get space for pages\n");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
for_each_sg_page(obj->pages->sgl, &sg_iter, obj->pages->nents, 0) {
|
||||
pages[i] = sg_page_iter_page(&sg_iter);
|
||||
i++;
|
||||
}
|
||||
for_each_sg_page(obj->pages->sgl, &sg_iter, npages, first_page)
|
||||
pages[i++] = sg_page_iter_page(&sg_iter);
|
||||
|
||||
addr = vmap(pages, i, 0, PAGE_KERNEL);
|
||||
if (addr == NULL) {
|
||||
@@ -855,61 +857,61 @@ static u32 *copy_batch(struct drm_i915_gem_object *dest_obj,
|
||||
u32 batch_start_offset,
|
||||
u32 batch_len)
|
||||
{
|
||||
int ret = 0;
|
||||
int needs_clflush = 0;
|
||||
u32 *src_base, *dest_base = NULL;
|
||||
u32 *src_addr, *dest_addr;
|
||||
u32 offset = batch_start_offset / sizeof(*dest_addr);
|
||||
u32 end = batch_start_offset + batch_len;
|
||||
void *src_base, *src;
|
||||
void *dst = NULL;
|
||||
int ret;
|
||||
|
||||
if (end > dest_obj->base.size || end > src_obj->base.size)
|
||||
if (batch_len > dest_obj->base.size ||
|
||||
batch_len + batch_start_offset > src_obj->base.size)
|
||||
return ERR_PTR(-E2BIG);
|
||||
|
||||
ret = i915_gem_obj_prepare_shmem_read(src_obj, &needs_clflush);
|
||||
if (ret) {
|
||||
DRM_DEBUG_DRIVER("CMD: failed to prep read\n");
|
||||
DRM_DEBUG_DRIVER("CMD: failed to prepare shadow batch\n");
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
src_base = vmap_batch(src_obj);
|
||||
src_base = vmap_batch(src_obj, batch_start_offset, batch_len);
|
||||
if (!src_base) {
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to vmap batch\n");
|
||||
ret = -ENOMEM;
|
||||
goto unpin_src;
|
||||
}
|
||||
|
||||
src_addr = src_base + offset;
|
||||
|
||||
if (needs_clflush)
|
||||
drm_clflush_virt_range((char *)src_addr, batch_len);
|
||||
ret = i915_gem_object_get_pages(dest_obj);
|
||||
if (ret) {
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to get pages for shadow batch\n");
|
||||
goto unmap_src;
|
||||
}
|
||||
i915_gem_object_pin_pages(dest_obj);
|
||||
|
||||
ret = i915_gem_object_set_to_cpu_domain(dest_obj, true);
|
||||
if (ret) {
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to set batch CPU domain\n");
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to set shadow batch to CPU\n");
|
||||
goto unmap_src;
|
||||
}
|
||||
|
||||
dest_base = vmap_batch(dest_obj);
|
||||
if (!dest_base) {
|
||||
dst = vmap_batch(dest_obj, 0, batch_len);
|
||||
if (!dst) {
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to vmap shadow batch\n");
|
||||
i915_gem_object_unpin_pages(dest_obj);
|
||||
ret = -ENOMEM;
|
||||
goto unmap_src;
|
||||
}
|
||||
|
||||
dest_addr = dest_base + offset;
|
||||
src = src_base + offset_in_page(batch_start_offset);
|
||||
if (needs_clflush)
|
||||
drm_clflush_virt_range(src, batch_len);
|
||||
|
||||
if (batch_start_offset != 0)
|
||||
memset((u8 *)dest_base, 0, batch_start_offset);
|
||||
|
||||
memcpy(dest_addr, src_addr, batch_len);
|
||||
memset((u8 *)dest_addr + batch_len, 0, dest_obj->base.size - end);
|
||||
memcpy(dst, src, batch_len);
|
||||
|
||||
unmap_src:
|
||||
vunmap(src_base);
|
||||
unpin_src:
|
||||
i915_gem_object_unpin_pages(src_obj);
|
||||
|
||||
return ret ? ERR_PTR(ret) : dest_base;
|
||||
return ret ? ERR_PTR(ret) : dst;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1046,34 +1048,26 @@ int i915_parse_cmds(struct intel_engine_cs *ring,
|
||||
u32 batch_len,
|
||||
bool is_master)
|
||||
{
|
||||
int ret = 0;
|
||||
u32 *cmd, *batch_base, *batch_end;
|
||||
struct drm_i915_cmd_descriptor default_desc = { 0 };
|
||||
bool oacontrol_set = false; /* OACONTROL tracking. See check_cmd() */
|
||||
|
||||
ret = i915_gem_obj_ggtt_pin(shadow_batch_obj, 4096, 0);
|
||||
if (ret) {
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to pin shadow batch\n");
|
||||
return -1;
|
||||
}
|
||||
int ret = 0;
|
||||
|
||||
batch_base = copy_batch(shadow_batch_obj, batch_obj,
|
||||
batch_start_offset, batch_len);
|
||||
if (IS_ERR(batch_base)) {
|
||||
DRM_DEBUG_DRIVER("CMD: Failed to copy batch\n");
|
||||
i915_gem_object_ggtt_unpin(shadow_batch_obj);
|
||||
return PTR_ERR(batch_base);
|
||||
}
|
||||
|
||||
cmd = batch_base + (batch_start_offset / sizeof(*cmd));
|
||||
|
||||
/*
|
||||
* We use the batch length as size because the shadow object is as
|
||||
* large or larger and copy_batch() will write MI_NOPs to the extra
|
||||
* space. Parsing should be faster in some cases this way.
|
||||
*/
|
||||
batch_end = cmd + (batch_len / sizeof(*batch_end));
|
||||
batch_end = batch_base + (batch_len / sizeof(*batch_end));
|
||||
|
||||
cmd = batch_base;
|
||||
while (cmd < batch_end) {
|
||||
const struct drm_i915_cmd_descriptor *desc;
|
||||
u32 length;
|
||||
@@ -1132,7 +1126,7 @@ int i915_parse_cmds(struct intel_engine_cs *ring,
|
||||
}
|
||||
|
||||
vunmap(batch_base);
|
||||
i915_gem_object_ggtt_unpin(shadow_batch_obj);
|
||||
i915_gem_object_unpin_pages(shadow_batch_obj);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -139,9 +139,10 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
|
||||
obj->madv == I915_MADV_DONTNEED ? " purgeable" : "");
|
||||
if (obj->base.name)
|
||||
seq_printf(m, " (name: %d)", obj->base.name);
|
||||
list_for_each_entry(vma, &obj->vma_list, vma_link)
|
||||
list_for_each_entry(vma, &obj->vma_list, vma_link) {
|
||||
if (vma->pin_count > 0)
|
||||
pin_count++;
|
||||
}
|
||||
seq_printf(m, " (pinned x %d)", pin_count);
|
||||
if (obj->pin_display)
|
||||
seq_printf(m, " (display)");
|
||||
@@ -580,7 +581,7 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
|
||||
seq_printf(m, "Flip queued on frame %d, (was ready on frame %d), now %d\n",
|
||||
work->flip_queued_vblank,
|
||||
work->flip_ready_vblank,
|
||||
drm_vblank_count(dev, crtc->pipe));
|
||||
drm_crtc_vblank_count(&crtc->base));
|
||||
if (work->enable_stall_check)
|
||||
seq_puts(m, "Stall check enabled, ");
|
||||
else
|
||||
@@ -2185,7 +2186,7 @@ static void gen6_ppgtt_info(struct seq_file *m, struct drm_device *dev)
|
||||
struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
|
||||
|
||||
seq_puts(m, "aliasing PPGTT:\n");
|
||||
seq_printf(m, "pd gtt offset: 0x%08x\n", ppgtt->pd_offset);
|
||||
seq_printf(m, "pd gtt offset: 0x%08x\n", ppgtt->pd.pd_offset);
|
||||
|
||||
ppgtt->debug_dump(ppgtt, m);
|
||||
}
|
||||
@@ -4191,7 +4192,7 @@ i915_max_freq_set(void *data, u64 val)
|
||||
{
|
||||
struct drm_device *dev = data;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
u32 rp_state_cap, hw_max, hw_min;
|
||||
u32 hw_max, hw_min;
|
||||
int ret;
|
||||
|
||||
if (INTEL_INFO(dev)->gen < 6)
|
||||
@@ -4208,18 +4209,10 @@ i915_max_freq_set(void *data, u64 val)
|
||||
/*
|
||||
* Turbo will still be enabled, but won't go above the set value.
|
||||
*/
|
||||
if (IS_VALLEYVIEW(dev)) {
|
||||
val = intel_freq_opcode(dev_priv, val);
|
||||
|
||||
hw_max = dev_priv->rps.max_freq;
|
||||
hw_min = dev_priv->rps.min_freq;
|
||||
} else {
|
||||
val = intel_freq_opcode(dev_priv, val);
|
||||
|
||||
rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
|
||||
hw_max = dev_priv->rps.max_freq;
|
||||
hw_min = (rp_state_cap >> 16) & 0xff;
|
||||
}
|
||||
|
||||
if (val < hw_min || val > hw_max || val < dev_priv->rps.min_freq_softlimit) {
|
||||
mutex_unlock(&dev_priv->rps.hw_lock);
|
||||
@@ -4266,7 +4259,7 @@ i915_min_freq_set(void *data, u64 val)
|
||||
{
|
||||
struct drm_device *dev = data;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
u32 rp_state_cap, hw_max, hw_min;
|
||||
u32 hw_max, hw_min;
|
||||
int ret;
|
||||
|
||||
if (INTEL_INFO(dev)->gen < 6)
|
||||
@@ -4283,18 +4276,10 @@ i915_min_freq_set(void *data, u64 val)
|
||||
/*
|
||||
* Turbo will still be enabled, but won't go below the set value.
|
||||
*/
|
||||
if (IS_VALLEYVIEW(dev)) {
|
||||
val = intel_freq_opcode(dev_priv, val);
|
||||
|
||||
hw_max = dev_priv->rps.max_freq;
|
||||
hw_min = dev_priv->rps.min_freq;
|
||||
} else {
|
||||
val = intel_freq_opcode(dev_priv, val);
|
||||
|
||||
rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
|
||||
hw_max = dev_priv->rps.max_freq;
|
||||
hw_min = (rp_state_cap >> 16) & 0xff;
|
||||
}
|
||||
|
||||
if (val < hw_min || val > hw_max || val > dev_priv->rps.max_freq_softlimit) {
|
||||
mutex_unlock(&dev_priv->rps.hw_lock);
|
||||
@@ -4370,6 +4355,85 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_cache_sharing_fops,
|
||||
i915_cache_sharing_get, i915_cache_sharing_set,
|
||||
"%llu\n");
|
||||
|
||||
static int i915_sseu_status(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct drm_info_node *node = (struct drm_info_node *) m->private;
|
||||
struct drm_device *dev = node->minor->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
unsigned int s_tot = 0, ss_tot = 0, ss_per = 0, eu_tot = 0, eu_per = 0;
|
||||
|
||||
if (INTEL_INFO(dev)->gen < 9)
|
||||
return -ENODEV;
|
||||
|
||||
seq_puts(m, "SSEU Device Info\n");
|
||||
seq_printf(m, " Available Slice Total: %u\n",
|
||||
INTEL_INFO(dev)->slice_total);
|
||||
seq_printf(m, " Available Subslice Total: %u\n",
|
||||
INTEL_INFO(dev)->subslice_total);
|
||||
seq_printf(m, " Available Subslice Per Slice: %u\n",
|
||||
INTEL_INFO(dev)->subslice_per_slice);
|
||||
seq_printf(m, " Available EU Total: %u\n",
|
||||
INTEL_INFO(dev)->eu_total);
|
||||
seq_printf(m, " Available EU Per Subslice: %u\n",
|
||||
INTEL_INFO(dev)->eu_per_subslice);
|
||||
seq_printf(m, " Has Slice Power Gating: %s\n",
|
||||
yesno(INTEL_INFO(dev)->has_slice_pg));
|
||||
seq_printf(m, " Has Subslice Power Gating: %s\n",
|
||||
yesno(INTEL_INFO(dev)->has_subslice_pg));
|
||||
seq_printf(m, " Has EU Power Gating: %s\n",
|
||||
yesno(INTEL_INFO(dev)->has_eu_pg));
|
||||
|
||||
seq_puts(m, "SSEU Device Status\n");
|
||||
if (IS_SKYLAKE(dev)) {
|
||||
const int s_max = 3, ss_max = 4;
|
||||
int s, ss;
|
||||
u32 s_reg[s_max], eu_reg[2*s_max], eu_mask[2];
|
||||
|
||||
s_reg[0] = I915_READ(GEN9_SLICE0_PGCTL_ACK);
|
||||
s_reg[1] = I915_READ(GEN9_SLICE1_PGCTL_ACK);
|
||||
s_reg[2] = I915_READ(GEN9_SLICE2_PGCTL_ACK);
|
||||
eu_reg[0] = I915_READ(GEN9_SLICE0_SS01_EU_PGCTL_ACK);
|
||||
eu_reg[1] = I915_READ(GEN9_SLICE0_SS23_EU_PGCTL_ACK);
|
||||
eu_reg[2] = I915_READ(GEN9_SLICE1_SS01_EU_PGCTL_ACK);
|
||||
eu_reg[3] = I915_READ(GEN9_SLICE1_SS23_EU_PGCTL_ACK);
|
||||
eu_reg[4] = I915_READ(GEN9_SLICE2_SS01_EU_PGCTL_ACK);
|
||||
eu_reg[5] = I915_READ(GEN9_SLICE2_SS23_EU_PGCTL_ACK);
|
||||
eu_mask[0] = GEN9_PGCTL_SSA_EU08_ACK |
|
||||
GEN9_PGCTL_SSA_EU19_ACK |
|
||||
GEN9_PGCTL_SSA_EU210_ACK |
|
||||
GEN9_PGCTL_SSA_EU311_ACK;
|
||||
eu_mask[1] = GEN9_PGCTL_SSB_EU08_ACK |
|
||||
GEN9_PGCTL_SSB_EU19_ACK |
|
||||
GEN9_PGCTL_SSB_EU210_ACK |
|
||||
GEN9_PGCTL_SSB_EU311_ACK;
|
||||
|
||||
for (s = 0; s < s_max; s++) {
|
||||
if ((s_reg[s] & GEN9_PGCTL_SLICE_ACK) == 0)
|
||||
/* skip disabled slice */
|
||||
continue;
|
||||
|
||||
s_tot++;
|
||||
ss_per = INTEL_INFO(dev)->subslice_per_slice;
|
||||
ss_tot += ss_per;
|
||||
for (ss = 0; ss < ss_max; ss++) {
|
||||
unsigned int eu_cnt;
|
||||
|
||||
eu_cnt = 2 * hweight32(eu_reg[2*s + ss/2] &
|
||||
eu_mask[ss%2]);
|
||||
eu_tot += eu_cnt;
|
||||
eu_per = max(eu_per, eu_cnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
seq_printf(m, " Enabled Slice Total: %u\n", s_tot);
|
||||
seq_printf(m, " Enabled Subslice Total: %u\n", ss_tot);
|
||||
seq_printf(m, " Enabled Subslice Per Slice: %u\n", ss_per);
|
||||
seq_printf(m, " Enabled EU Total: %u\n", eu_tot);
|
||||
seq_printf(m, " Enabled EU Per Subslice: %u\n", eu_per);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_forcewake_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct drm_device *dev = inode->i_private;
|
||||
@@ -4483,6 +4547,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
|
||||
{"i915_dp_mst_info", i915_dp_mst_info, 0},
|
||||
{"i915_wa_registers", i915_wa_registers, 0},
|
||||
{"i915_ddb_info", i915_ddb_info, 0},
|
||||
{"i915_sseu_status", i915_sseu_status, 0},
|
||||
};
|
||||
#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
|
||||
|
||||
|
||||
@@ -606,6 +606,7 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize slice/subslice/EU info */
|
||||
if (IS_CHERRYVIEW(dev)) {
|
||||
u32 fuse, mask_eu;
|
||||
|
||||
@@ -615,9 +616,92 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
|
||||
CHV_FGT_EU_DIS_SS1_R0_MASK |
|
||||
CHV_FGT_EU_DIS_SS1_R1_MASK);
|
||||
info->eu_total = 16 - hweight32(mask_eu);
|
||||
} else if (IS_SKYLAKE(dev)) {
|
||||
const int s_max = 3, ss_max = 4, eu_max = 8;
|
||||
int s, ss;
|
||||
u32 fuse2, eu_disable[s_max], s_enable, ss_disable;
|
||||
|
||||
fuse2 = I915_READ(GEN8_FUSE2);
|
||||
s_enable = (fuse2 & GEN8_F2_S_ENA_MASK) >>
|
||||
GEN8_F2_S_ENA_SHIFT;
|
||||
ss_disable = (fuse2 & GEN9_F2_SS_DIS_MASK) >>
|
||||
GEN9_F2_SS_DIS_SHIFT;
|
||||
|
||||
eu_disable[0] = I915_READ(GEN8_EU_DISABLE0);
|
||||
eu_disable[1] = I915_READ(GEN8_EU_DISABLE1);
|
||||
eu_disable[2] = I915_READ(GEN8_EU_DISABLE2);
|
||||
|
||||
info->slice_total = hweight32(s_enable);
|
||||
/*
|
||||
* The subslice disable field is global, i.e. it applies
|
||||
* to each of the enabled slices.
|
||||
*/
|
||||
info->subslice_per_slice = ss_max - hweight32(ss_disable);
|
||||
info->subslice_total = info->slice_total *
|
||||
info->subslice_per_slice;
|
||||
|
||||
/*
|
||||
* Iterate through enabled slices and subslices to
|
||||
* count the total enabled EU.
|
||||
*/
|
||||
for (s = 0; s < s_max; s++) {
|
||||
if (!(s_enable & (0x1 << s)))
|
||||
/* skip disabled slice */
|
||||
continue;
|
||||
|
||||
for (ss = 0; ss < ss_max; ss++) {
|
||||
u32 n_disabled;
|
||||
|
||||
if (ss_disable & (0x1 << ss))
|
||||
/* skip disabled subslice */
|
||||
continue;
|
||||
|
||||
n_disabled = hweight8(eu_disable[s] >>
|
||||
(ss * eu_max));
|
||||
|
||||
/*
|
||||
* Record which subslice(s) has(have) 7 EUs. we
|
||||
* can tune the hash used to spread work among
|
||||
* subslices if they are unbalanced.
|
||||
*/
|
||||
if (eu_max - n_disabled == 7)
|
||||
info->subslice_7eu[s] |= 1 << ss;
|
||||
|
||||
info->eu_total += eu_max - n_disabled;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* SKL is expected to always have a uniform distribution
|
||||
* of EU across subslices with the exception that any one
|
||||
* EU in any one subslice may be fused off for die
|
||||
* recovery.
|
||||
*/
|
||||
info->eu_per_subslice = info->subslice_total ?
|
||||
DIV_ROUND_UP(info->eu_total,
|
||||
info->subslice_total) : 0;
|
||||
/*
|
||||
* SKL supports slice power gating on devices with more than
|
||||
* one slice, and supports EU power gating on devices with
|
||||
* more than one EU pair per subslice.
|
||||
*/
|
||||
info->has_slice_pg = (info->slice_total > 1) ? 1 : 0;
|
||||
info->has_subslice_pg = 0;
|
||||
info->has_eu_pg = (info->eu_per_subslice > 2) ? 1 : 0;
|
||||
}
|
||||
DRM_DEBUG_DRIVER("slice total: %u\n", info->slice_total);
|
||||
DRM_DEBUG_DRIVER("subslice total: %u\n", info->subslice_total);
|
||||
DRM_DEBUG_DRIVER("subslice per slice: %u\n", info->subslice_per_slice);
|
||||
DRM_DEBUG_DRIVER("EU total: %u\n", info->eu_total);
|
||||
DRM_DEBUG_DRIVER("EU per subslice: %u\n", info->eu_per_subslice);
|
||||
DRM_DEBUG_DRIVER("has slice power gating: %s\n",
|
||||
info->has_slice_pg ? "y" : "n");
|
||||
DRM_DEBUG_DRIVER("has subslice power gating: %s\n",
|
||||
info->has_subslice_pg ? "y" : "n");
|
||||
DRM_DEBUG_DRIVER("has EU power gating: %s\n",
|
||||
info->has_eu_pg ? "y" : "n");
|
||||
}
|
||||
|
||||
/**
|
||||
* i915_driver_load - setup chip and create an initial config
|
||||
* @dev: DRM device
|
||||
@@ -638,17 +722,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
|
||||
info = (struct intel_device_info *) flags;
|
||||
|
||||
/* Refuse to load on gen6+ without kms enabled. */
|
||||
if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
DRM_INFO("Your hardware requires kernel modesetting (KMS)\n");
|
||||
DRM_INFO("See CONFIG_DRM_I915_KMS, nomodeset, and i915.modeset parameters\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* UMS needs agp support. */
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET) && !dev->agp)
|
||||
return -EINVAL;
|
||||
|
||||
dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
|
||||
if (dev_priv == NULL)
|
||||
return -ENOMEM;
|
||||
@@ -718,7 +791,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
if (ret)
|
||||
goto out_regs;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
/* WARNING: Apparently we must kick fbdev drivers before vgacon,
|
||||
* otherwise the vga fbdev driver falls over. */
|
||||
ret = i915_kick_out_firmware_fb(dev_priv);
|
||||
@@ -732,7 +804,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
DRM_ERROR("failed to remove conflicting VGA console\n");
|
||||
goto out_gtt;
|
||||
}
|
||||
}
|
||||
|
||||
pci_set_master(dev->pdev);
|
||||
|
||||
@@ -835,13 +906,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
|
||||
|
||||
intel_power_domains_init(dev_priv);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
ret = i915_load_modeset_init(dev);
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("failed to init modeset\n");
|
||||
goto out_power_well;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Notify a valid surface after modesetting,
|
||||
@@ -929,12 +998,10 @@ int i915_driver_unload(struct drm_device *dev)
|
||||
|
||||
acpi_video_unregister();
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
intel_fbdev_fini(dev);
|
||||
|
||||
drm_vblank_cleanup(dev);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
intel_modeset_cleanup(dev);
|
||||
|
||||
/*
|
||||
@@ -949,7 +1016,6 @@ int i915_driver_unload(struct drm_device *dev)
|
||||
|
||||
vga_switcheroo_unregister_client(dev->pdev);
|
||||
vga_client_register(dev->pdev, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Free error state after interrupts are fully disabled. */
|
||||
cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
|
||||
@@ -960,7 +1026,6 @@ int i915_driver_unload(struct drm_device *dev)
|
||||
|
||||
intel_opregion_fini(dev);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
/* Flush any outstanding unpin_work. */
|
||||
flush_workqueue(dev_priv->wq);
|
||||
|
||||
@@ -970,7 +1035,6 @@ int i915_driver_unload(struct drm_device *dev)
|
||||
i915_gem_context_fini(dev);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
i915_gem_cleanup_stolen(dev);
|
||||
}
|
||||
|
||||
intel_teardown_gmbus(dev);
|
||||
intel_teardown_mchbar(dev);
|
||||
@@ -1031,7 +1095,6 @@ void i915_driver_preclose(struct drm_device *dev, struct drm_file *file)
|
||||
i915_gem_release(dev, file);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
intel_modeset_preclose(dev, file);
|
||||
}
|
||||
|
||||
|
||||
@@ -568,6 +568,7 @@ static int i915_drm_suspend(struct drm_device *dev)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_crtc *crtc;
|
||||
pci_power_t opregion_target_state;
|
||||
int error;
|
||||
|
||||
/* ignore lid events during suspend */
|
||||
mutex_lock(&dev_priv->modeset_restore_lock);
|
||||
@@ -582,10 +583,6 @@ static int i915_drm_suspend(struct drm_device *dev)
|
||||
|
||||
pci_save_state(dev->pdev);
|
||||
|
||||
/* If KMS is active, we do the leavevt stuff here */
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
int error;
|
||||
|
||||
error = i915_gem_suspend(dev);
|
||||
if (error) {
|
||||
dev_err(&dev->pdev->dev,
|
||||
@@ -612,7 +609,6 @@ static int i915_drm_suspend(struct drm_device *dev)
|
||||
intel_suspend_encoders(dev_priv);
|
||||
|
||||
intel_suspend_hw(dev);
|
||||
}
|
||||
|
||||
i915_gem_suspend_gtt_mappings(dev);
|
||||
|
||||
@@ -684,17 +680,13 @@ static int i915_drm_resume(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
i915_gem_restore_gtt_mappings(dev);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
}
|
||||
|
||||
i915_restore_state(dev);
|
||||
intel_opregion_setup(dev);
|
||||
|
||||
/* KMS EnterVT equivalent */
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
intel_init_pch_refclk(dev);
|
||||
drm_mode_config_reset(dev);
|
||||
|
||||
@@ -730,7 +722,6 @@ static int i915_drm_resume(struct drm_device *dev)
|
||||
intel_hpd_init(dev_priv);
|
||||
/* Config may have changed between suspend and resume */
|
||||
drm_helper_hpd_irq_event(dev);
|
||||
}
|
||||
|
||||
intel_opregion_init(dev);
|
||||
|
||||
@@ -866,7 +857,7 @@ int i915_reset(struct drm_device *dev)
|
||||
* was running at the time of the reset (i.e. we weren't VT
|
||||
* switched away).
|
||||
*/
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
|
||||
/* Used to prevent gem_check_wedged returning -EAGAIN during gpu reset */
|
||||
dev_priv->gpu_error.reload_in_reset = true;
|
||||
|
||||
@@ -894,9 +885,6 @@ int i915_reset(struct drm_device *dev)
|
||||
*/
|
||||
if (INTEL_INFO(dev)->gen > 5)
|
||||
intel_enable_gt_powersave(dev);
|
||||
} else {
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+16
-136
@@ -56,7 +56,7 @@
|
||||
|
||||
#define DRIVER_NAME "i915"
|
||||
#define DRIVER_DESC "Intel Graphics"
|
||||
#define DRIVER_DATE "20150214"
|
||||
#define DRIVER_DATE "20150227"
|
||||
|
||||
#undef WARN_ON
|
||||
/* Many gcc seem to no see through this and fall over :( */
|
||||
@@ -693,7 +693,18 @@ struct intel_device_info {
|
||||
int trans_offsets[I915_MAX_TRANSCODERS];
|
||||
int palette_offsets[I915_MAX_PIPES];
|
||||
int cursor_offsets[I915_MAX_PIPES];
|
||||
unsigned int eu_total;
|
||||
|
||||
/* Slice/subslice/EU info */
|
||||
u8 slice_total;
|
||||
u8 subslice_total;
|
||||
u8 subslice_per_slice;
|
||||
u8 eu_total;
|
||||
u8 eu_per_subslice;
|
||||
/* For each slice, which subslice(s) has(have) 7 EUs (bitfield)? */
|
||||
u8 subslice_7eu[3];
|
||||
u8 has_slice_pg:1;
|
||||
u8 has_subslice_pg:1;
|
||||
u8 has_eu_pg:1;
|
||||
};
|
||||
|
||||
#undef DEFINE_FLAG
|
||||
@@ -889,150 +900,21 @@ struct intel_gmbus {
|
||||
};
|
||||
|
||||
struct i915_suspend_saved_registers {
|
||||
u8 saveLBB;
|
||||
u32 saveDSPACNTR;
|
||||
u32 saveDSPBCNTR;
|
||||
u32 saveDSPARB;
|
||||
u32 savePIPEACONF;
|
||||
u32 savePIPEBCONF;
|
||||
u32 savePIPEASRC;
|
||||
u32 savePIPEBSRC;
|
||||
u32 saveFPA0;
|
||||
u32 saveFPA1;
|
||||
u32 saveDPLL_A;
|
||||
u32 saveDPLL_A_MD;
|
||||
u32 saveHTOTAL_A;
|
||||
u32 saveHBLANK_A;
|
||||
u32 saveHSYNC_A;
|
||||
u32 saveVTOTAL_A;
|
||||
u32 saveVBLANK_A;
|
||||
u32 saveVSYNC_A;
|
||||
u32 saveBCLRPAT_A;
|
||||
u32 saveTRANSACONF;
|
||||
u32 saveTRANS_HTOTAL_A;
|
||||
u32 saveTRANS_HBLANK_A;
|
||||
u32 saveTRANS_HSYNC_A;
|
||||
u32 saveTRANS_VTOTAL_A;
|
||||
u32 saveTRANS_VBLANK_A;
|
||||
u32 saveTRANS_VSYNC_A;
|
||||
u32 savePIPEASTAT;
|
||||
u32 saveDSPASTRIDE;
|
||||
u32 saveDSPASIZE;
|
||||
u32 saveDSPAPOS;
|
||||
u32 saveDSPAADDR;
|
||||
u32 saveDSPASURF;
|
||||
u32 saveDSPATILEOFF;
|
||||
u32 savePFIT_PGM_RATIOS;
|
||||
u32 saveBLC_HIST_CTL;
|
||||
u32 saveBLC_PWM_CTL;
|
||||
u32 saveBLC_PWM_CTL2;
|
||||
u32 saveBLC_CPU_PWM_CTL;
|
||||
u32 saveBLC_CPU_PWM_CTL2;
|
||||
u32 saveFPB0;
|
||||
u32 saveFPB1;
|
||||
u32 saveDPLL_B;
|
||||
u32 saveDPLL_B_MD;
|
||||
u32 saveHTOTAL_B;
|
||||
u32 saveHBLANK_B;
|
||||
u32 saveHSYNC_B;
|
||||
u32 saveVTOTAL_B;
|
||||
u32 saveVBLANK_B;
|
||||
u32 saveVSYNC_B;
|
||||
u32 saveBCLRPAT_B;
|
||||
u32 saveTRANSBCONF;
|
||||
u32 saveTRANS_HTOTAL_B;
|
||||
u32 saveTRANS_HBLANK_B;
|
||||
u32 saveTRANS_HSYNC_B;
|
||||
u32 saveTRANS_VTOTAL_B;
|
||||
u32 saveTRANS_VBLANK_B;
|
||||
u32 saveTRANS_VSYNC_B;
|
||||
u32 savePIPEBSTAT;
|
||||
u32 saveDSPBSTRIDE;
|
||||
u32 saveDSPBSIZE;
|
||||
u32 saveDSPBPOS;
|
||||
u32 saveDSPBADDR;
|
||||
u32 saveDSPBSURF;
|
||||
u32 saveDSPBTILEOFF;
|
||||
u32 saveVGA0;
|
||||
u32 saveVGA1;
|
||||
u32 saveVGA_PD;
|
||||
u32 saveVGACNTRL;
|
||||
u32 saveADPA;
|
||||
u32 saveLVDS;
|
||||
u32 savePP_ON_DELAYS;
|
||||
u32 savePP_OFF_DELAYS;
|
||||
u32 saveDVOA;
|
||||
u32 saveDVOB;
|
||||
u32 saveDVOC;
|
||||
u32 savePP_ON;
|
||||
u32 savePP_OFF;
|
||||
u32 savePP_CONTROL;
|
||||
u32 savePP_DIVISOR;
|
||||
u32 savePFIT_CONTROL;
|
||||
u32 save_palette_a[256];
|
||||
u32 save_palette_b[256];
|
||||
u32 saveFBC_CONTROL;
|
||||
u32 saveIER;
|
||||
u32 saveIIR;
|
||||
u32 saveIMR;
|
||||
u32 saveDEIER;
|
||||
u32 saveDEIMR;
|
||||
u32 saveGTIER;
|
||||
u32 saveGTIMR;
|
||||
u32 saveFDI_RXA_IMR;
|
||||
u32 saveFDI_RXB_IMR;
|
||||
u32 saveCACHE_MODE_0;
|
||||
u32 saveMI_ARB_STATE;
|
||||
u32 saveSWF0[16];
|
||||
u32 saveSWF1[16];
|
||||
u32 saveSWF2[3];
|
||||
u8 saveMSR;
|
||||
u8 saveSR[8];
|
||||
u8 saveGR[25];
|
||||
u8 saveAR_INDEX;
|
||||
u8 saveAR[21];
|
||||
u8 saveDACMASK;
|
||||
u8 saveCR[37];
|
||||
uint64_t saveFENCE[I915_MAX_NUM_FENCES];
|
||||
u32 saveCURACNTR;
|
||||
u32 saveCURAPOS;
|
||||
u32 saveCURABASE;
|
||||
u32 saveCURBCNTR;
|
||||
u32 saveCURBPOS;
|
||||
u32 saveCURBBASE;
|
||||
u32 saveCURSIZE;
|
||||
u32 saveDP_B;
|
||||
u32 saveDP_C;
|
||||
u32 saveDP_D;
|
||||
u32 savePIPEA_GMCH_DATA_M;
|
||||
u32 savePIPEB_GMCH_DATA_M;
|
||||
u32 savePIPEA_GMCH_DATA_N;
|
||||
u32 savePIPEB_GMCH_DATA_N;
|
||||
u32 savePIPEA_DP_LINK_M;
|
||||
u32 savePIPEB_DP_LINK_M;
|
||||
u32 savePIPEA_DP_LINK_N;
|
||||
u32 savePIPEB_DP_LINK_N;
|
||||
u32 saveFDI_RXA_CTL;
|
||||
u32 saveFDI_TXA_CTL;
|
||||
u32 saveFDI_RXB_CTL;
|
||||
u32 saveFDI_TXB_CTL;
|
||||
u32 savePFA_CTL_1;
|
||||
u32 savePFB_CTL_1;
|
||||
u32 savePFA_WIN_SZ;
|
||||
u32 savePFB_WIN_SZ;
|
||||
u32 savePFA_WIN_POS;
|
||||
u32 savePFB_WIN_POS;
|
||||
u32 savePCH_DREF_CONTROL;
|
||||
u32 saveDISP_ARB_CTL;
|
||||
u32 savePIPEA_DATA_M1;
|
||||
u32 savePIPEA_DATA_N1;
|
||||
u32 savePIPEA_LINK_M1;
|
||||
u32 savePIPEA_LINK_N1;
|
||||
u32 savePIPEB_DATA_M1;
|
||||
u32 savePIPEB_DATA_N1;
|
||||
u32 savePIPEB_LINK_M1;
|
||||
u32 savePIPEB_LINK_N1;
|
||||
u32 saveMCHBAR_RENDER_STANDBY;
|
||||
u32 savePCH_PORT_HOTPLUG;
|
||||
u16 saveGCDGMBUS;
|
||||
};
|
||||
@@ -1455,6 +1337,7 @@ struct intel_vbt_data {
|
||||
bool edp_initialized;
|
||||
bool edp_support;
|
||||
int edp_bpp;
|
||||
bool edp_low_vswing;
|
||||
struct edp_power_seq edp_pps;
|
||||
|
||||
struct {
|
||||
@@ -2144,8 +2027,9 @@ struct drm_i915_gem_request {
|
||||
/** Position in the ringbuffer of the end of the whole request */
|
||||
u32 tail;
|
||||
|
||||
/** Context related to this request */
|
||||
/** Context and ring buffer related to this request */
|
||||
struct intel_context *ctx;
|
||||
struct intel_ringbuffer *ringbuf;
|
||||
|
||||
/** Batch buffer related to this request if any */
|
||||
struct drm_i915_gem_object *batch_obj;
|
||||
@@ -3123,10 +3007,6 @@ int i915_parse_cmds(struct intel_engine_cs *ring,
|
||||
extern int i915_save_state(struct drm_device *dev);
|
||||
extern int i915_restore_state(struct drm_device *dev);
|
||||
|
||||
/* i915_ums.c */
|
||||
void i915_save_display_reg(struct drm_device *dev);
|
||||
void i915_restore_display_reg(struct drm_device *dev);
|
||||
|
||||
/* i915_sysfs.c */
|
||||
void i915_setup_sysfs(struct drm_device *dev_priv);
|
||||
void i915_teardown_sysfs(struct drm_device *dev_priv);
|
||||
|
||||
@@ -2763,7 +2763,6 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring)
|
||||
|
||||
while (!list_empty(&ring->request_list)) {
|
||||
struct drm_i915_gem_request *request;
|
||||
struct intel_ringbuffer *ringbuf;
|
||||
|
||||
request = list_first_entry(&ring->request_list,
|
||||
struct drm_i915_gem_request,
|
||||
@@ -2774,23 +2773,12 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring)
|
||||
|
||||
trace_i915_gem_request_retire(request);
|
||||
|
||||
/* This is one of the few common intersection points
|
||||
* between legacy ringbuffer submission and execlists:
|
||||
* we need to tell them apart in order to find the correct
|
||||
* ringbuffer to which the request belongs to.
|
||||
*/
|
||||
if (i915.enable_execlists) {
|
||||
struct intel_context *ctx = request->ctx;
|
||||
ringbuf = ctx->engine[ring->id].ringbuf;
|
||||
} else
|
||||
ringbuf = ring->buffer;
|
||||
|
||||
/* We know the GPU must have read the request to have
|
||||
* sent us the seqno + interrupt, so use the position
|
||||
* of tail of the request to update the last known position
|
||||
* of the GPU head.
|
||||
*/
|
||||
ringbuf->last_retired_head = request->postfix;
|
||||
request->ringbuf->last_retired_head = request->postfix;
|
||||
|
||||
i915_gem_free_request(request);
|
||||
}
|
||||
@@ -4238,7 +4226,7 @@ i915_gem_object_pin_view(struct drm_i915_gem_object *obj,
|
||||
fenceable = (vma->node.size == fence_size &&
|
||||
(vma->node.start & (fence_alignment - 1)) == 0);
|
||||
|
||||
mappable = (vma->node.start + obj->base.size <=
|
||||
mappable = (vma->node.start + fence_size <=
|
||||
dev_priv->gtt.mappable_end);
|
||||
|
||||
obj->map_and_fenceable = mappable && fenceable;
|
||||
@@ -4613,10 +4601,6 @@ i915_gem_suspend(struct drm_device *dev)
|
||||
|
||||
i915_gem_retire_requests(dev);
|
||||
|
||||
/* Under UMS, be paranoid and evict. */
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
i915_gem_evict_everything(dev);
|
||||
|
||||
i915_gem_stop_ringbuffers(dev);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
@@ -4973,18 +4957,8 @@ i915_gem_load(struct drm_device *dev)
|
||||
i915_gem_idle_work_handler);
|
||||
init_waitqueue_head(&dev_priv->gpu_error.reset_queue);
|
||||
|
||||
/* On GEN3 we really need to make sure the ARB C3 LP bit is set */
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET) && IS_GEN3(dev)) {
|
||||
I915_WRITE(MI_ARB_STATE,
|
||||
_MASKED_BIT_ENABLE(MI_ARB_C3_LP_WRITE_ENABLE));
|
||||
}
|
||||
|
||||
dev_priv->relative_constants_mode = I915_EXEC_CONSTANTS_REL_GENERAL;
|
||||
|
||||
/* Old X drivers will take 0-2 for front, back, depth buffers */
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
dev_priv->fence_reg_start = 3;
|
||||
|
||||
if (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev))
|
||||
dev_priv->num_fence_regs = 32;
|
||||
else if (INTEL_INFO(dev)->gen >= 4 || IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
|
||||
|
||||
@@ -296,11 +296,15 @@ void i915_gem_context_reset(struct drm_device *dev)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
int i;
|
||||
|
||||
/* In execlists mode we will unreference the context when the execlist
|
||||
* queue is cleared and the requests destroyed.
|
||||
*/
|
||||
if (i915.enable_execlists)
|
||||
if (i915.enable_execlists) {
|
||||
struct intel_context *ctx;
|
||||
|
||||
list_for_each_entry(ctx, &dev_priv->context_list, link) {
|
||||
intel_lr_context_reset(dev, ctx);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < I915_NUM_RINGS; i++) {
|
||||
struct intel_engine_cs *ring = &dev_priv->ring[i];
|
||||
|
||||
@@ -1076,16 +1076,15 @@ i915_gem_execbuffer_parse(struct intel_engine_cs *ring,
|
||||
struct drm_i915_gem_object *batch_obj,
|
||||
u32 batch_start_offset,
|
||||
u32 batch_len,
|
||||
bool is_master,
|
||||
u32 *flags)
|
||||
bool is_master)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(batch_obj->base.dev);
|
||||
struct drm_i915_gem_object *shadow_batch_obj;
|
||||
bool need_reloc = false;
|
||||
struct i915_vma *vma;
|
||||
int ret;
|
||||
|
||||
shadow_batch_obj = i915_gem_batch_pool_get(&dev_priv->mm.batch_pool,
|
||||
batch_obj->base.size);
|
||||
PAGE_ALIGN(batch_len));
|
||||
if (IS_ERR(shadow_batch_obj))
|
||||
return shadow_batch_obj;
|
||||
|
||||
@@ -1095,40 +1094,30 @@ i915_gem_execbuffer_parse(struct intel_engine_cs *ring,
|
||||
batch_start_offset,
|
||||
batch_len,
|
||||
is_master);
|
||||
if (ret) {
|
||||
if (ret == -EACCES)
|
||||
return batch_obj;
|
||||
} else {
|
||||
struct i915_vma *vma;
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
ret = i915_gem_obj_ggtt_pin(shadow_batch_obj, 0, 0);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
memset(shadow_exec_entry, 0, sizeof(*shadow_exec_entry));
|
||||
|
||||
vma = i915_gem_obj_to_ggtt(shadow_batch_obj);
|
||||
vma->exec_entry = shadow_exec_entry;
|
||||
vma->exec_entry->flags = __EXEC_OBJECT_PURGEABLE;
|
||||
vma->exec_entry->flags = __EXEC_OBJECT_PURGEABLE | __EXEC_OBJECT_HAS_PIN;
|
||||
drm_gem_object_reference(&shadow_batch_obj->base);
|
||||
i915_gem_execbuffer_reserve_vma(vma, ring, &need_reloc);
|
||||
list_add_tail(&vma->exec_list, &eb->vmas);
|
||||
|
||||
shadow_batch_obj->base.pending_read_domains =
|
||||
batch_obj->base.pending_read_domains;
|
||||
shadow_batch_obj->base.pending_read_domains = I915_GEM_DOMAIN_COMMAND;
|
||||
|
||||
/*
|
||||
* Set the DISPATCH_SECURE bit to remove the NON_SECURE
|
||||
* bit from MI_BATCH_BUFFER_START commands issued in the
|
||||
* dispatch_execbuffer implementations. We specifically
|
||||
* don't want that set when the command parser is
|
||||
* enabled.
|
||||
*
|
||||
* FIXME: with aliasing ppgtt, buffers that should only
|
||||
* be in ggtt still end up in the aliasing ppgtt. remove
|
||||
* this check when that is fixed.
|
||||
*/
|
||||
if (USES_FULL_PPGTT(dev))
|
||||
*flags |= I915_DISPATCH_SECURE;
|
||||
}
|
||||
return shadow_batch_obj;
|
||||
|
||||
return ret ? ERR_PTR(ret) : shadow_batch_obj;
|
||||
err:
|
||||
if (ret == -EACCES) /* unhandled chained batch */
|
||||
return batch_obj;
|
||||
else
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1138,7 +1127,7 @@ i915_gem_ringbuffer_submission(struct drm_device *dev, struct drm_file *file,
|
||||
struct drm_i915_gem_execbuffer2 *args,
|
||||
struct list_head *vmas,
|
||||
struct drm_i915_gem_object *batch_obj,
|
||||
u64 exec_start, u32 flags)
|
||||
u64 exec_start, u32 dispatch_flags)
|
||||
{
|
||||
struct drm_clip_rect *cliprects = NULL;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
@@ -1266,19 +1255,19 @@ i915_gem_ringbuffer_submission(struct drm_device *dev, struct drm_file *file,
|
||||
|
||||
ret = ring->dispatch_execbuffer(ring,
|
||||
exec_start, exec_len,
|
||||
flags);
|
||||
dispatch_flags);
|
||||
if (ret)
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
ret = ring->dispatch_execbuffer(ring,
|
||||
exec_start, exec_len,
|
||||
flags);
|
||||
dispatch_flags);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
trace_i915_gem_ring_dispatch(intel_ring_get_request(ring), flags);
|
||||
trace_i915_gem_ring_dispatch(intel_ring_get_request(ring), dispatch_flags);
|
||||
|
||||
i915_gem_execbuffer_move_to_active(vmas, ring);
|
||||
i915_gem_execbuffer_retire_commands(dev, file, ring, batch_obj);
|
||||
@@ -1353,7 +1342,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
struct i915_address_space *vm;
|
||||
const u32 ctx_id = i915_execbuffer2_get_context_id(*args);
|
||||
u64 exec_start = args->batch_start_offset;
|
||||
u32 flags;
|
||||
u32 dispatch_flags;
|
||||
int ret;
|
||||
bool need_relocs;
|
||||
|
||||
@@ -1364,15 +1353,15 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
flags = 0;
|
||||
dispatch_flags = 0;
|
||||
if (args->flags & I915_EXEC_SECURE) {
|
||||
if (!file->is_master || !capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
flags |= I915_DISPATCH_SECURE;
|
||||
dispatch_flags |= I915_DISPATCH_SECURE;
|
||||
}
|
||||
if (args->flags & I915_EXEC_IS_PINNED)
|
||||
flags |= I915_DISPATCH_PINNED;
|
||||
dispatch_flags |= I915_DISPATCH_PINNED;
|
||||
|
||||
if ((args->flags & I915_EXEC_RING_MASK) > LAST_USER_RING) {
|
||||
DRM_DEBUG("execbuf with unknown ring: %d\n",
|
||||
@@ -1494,12 +1483,27 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
batch_obj,
|
||||
args->batch_start_offset,
|
||||
args->batch_len,
|
||||
file->is_master,
|
||||
&flags);
|
||||
file->is_master);
|
||||
if (IS_ERR(batch_obj)) {
|
||||
ret = PTR_ERR(batch_obj);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the DISPATCH_SECURE bit to remove the NON_SECURE
|
||||
* bit from MI_BATCH_BUFFER_START commands issued in the
|
||||
* dispatch_execbuffer implementations. We specifically
|
||||
* don't want that set when the command parser is
|
||||
* enabled.
|
||||
*
|
||||
* FIXME: with aliasing ppgtt, buffers that should only
|
||||
* be in ggtt still end up in the aliasing ppgtt. remove
|
||||
* this check when that is fixed.
|
||||
*/
|
||||
if (USES_FULL_PPGTT(dev))
|
||||
dispatch_flags |= I915_DISPATCH_SECURE;
|
||||
|
||||
exec_start = 0;
|
||||
}
|
||||
|
||||
batch_obj->base.pending_read_domains |= I915_GEM_DOMAIN_COMMAND;
|
||||
@@ -1507,7 +1511,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
/* snb/ivb/vlv conflate the "batch in ppgtt" bit with the "non-secure
|
||||
* batch" bit. Hence we need to pin secure batches into the global gtt.
|
||||
* hsw should have this fixed, but bdw mucks it up again. */
|
||||
if (flags & I915_DISPATCH_SECURE) {
|
||||
if (dispatch_flags & I915_DISPATCH_SECURE) {
|
||||
/*
|
||||
* So on first glance it looks freaky that we pin the batch here
|
||||
* outside of the reservation loop. But:
|
||||
@@ -1527,7 +1531,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
exec_start += i915_gem_obj_offset(batch_obj, vm);
|
||||
|
||||
ret = dev_priv->gt.do_execbuf(dev, file, ring, ctx, args,
|
||||
&eb->vmas, batch_obj, exec_start, flags);
|
||||
&eb->vmas, batch_obj, exec_start,
|
||||
dispatch_flags);
|
||||
|
||||
/*
|
||||
* FIXME: We crucially rely upon the active tracking for the (ppgtt)
|
||||
@@ -1535,7 +1540,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
|
||||
* needs to be adjusted to also track the ggtt batch vma properly as
|
||||
* active.
|
||||
*/
|
||||
if (flags & I915_DISPATCH_SECURE)
|
||||
if (dispatch_flags & I915_DISPATCH_SECURE)
|
||||
i915_gem_object_ggtt_unpin(batch_obj);
|
||||
err:
|
||||
/* the request owns the ref now */
|
||||
|
||||
+209
-145
File diff suppressed because it is too large
Load Diff
@@ -187,6 +187,26 @@ struct i915_vma {
|
||||
u32 flags);
|
||||
};
|
||||
|
||||
struct i915_page_table_entry {
|
||||
struct page *page;
|
||||
dma_addr_t daddr;
|
||||
};
|
||||
|
||||
struct i915_page_directory_entry {
|
||||
struct page *page; /* NULL for GEN6-GEN7 */
|
||||
union {
|
||||
uint32_t pd_offset;
|
||||
dma_addr_t daddr;
|
||||
};
|
||||
|
||||
struct i915_page_table_entry *page_table[GEN6_PPGTT_PD_ENTRIES]; /* PDEs */
|
||||
};
|
||||
|
||||
struct i915_page_directory_pointer_entry {
|
||||
/* struct page *page; */
|
||||
struct i915_page_directory_entry *page_directory[GEN8_LEGACY_PDPES];
|
||||
};
|
||||
|
||||
struct i915_address_space {
|
||||
struct drm_mm mm;
|
||||
struct drm_device *dev;
|
||||
@@ -272,17 +292,8 @@ struct i915_hw_ppgtt {
|
||||
unsigned num_pd_entries;
|
||||
unsigned num_pd_pages; /* gen8+ */
|
||||
union {
|
||||
struct page **pt_pages;
|
||||
struct page **gen8_pt_pages[GEN8_LEGACY_PDPES];
|
||||
};
|
||||
struct page *pd_pages;
|
||||
union {
|
||||
uint32_t pd_offset;
|
||||
dma_addr_t pd_dma_addr[GEN8_LEGACY_PDPES];
|
||||
};
|
||||
union {
|
||||
dma_addr_t *pt_dma_addr;
|
||||
dma_addr_t *gen8_pt_dma_addr[GEN8_LEGACY_PDPES];
|
||||
struct i915_page_directory_pointer_entry pdp;
|
||||
struct i915_page_directory_entry pd;
|
||||
};
|
||||
|
||||
struct drm_i915_file_private *file_priv;
|
||||
|
||||
@@ -253,7 +253,7 @@ int i915_gem_stolen_setup_compression(struct drm_device *dev, int size, int fb_c
|
||||
if (!drm_mm_initialized(&dev_priv->mm.stolen))
|
||||
return -ENODEV;
|
||||
|
||||
if (size < dev_priv->fbc.uncompressed_size)
|
||||
if (size <= dev_priv->fbc.uncompressed_size)
|
||||
return 0;
|
||||
|
||||
/* Release any current block */
|
||||
|
||||
@@ -492,31 +492,6 @@ static void i915_enable_asle_pipestat(struct drm_device *dev)
|
||||
spin_unlock_irq(&dev_priv->irq_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* i915_pipe_enabled - check if a pipe is enabled
|
||||
* @dev: DRM device
|
||||
* @pipe: pipe to check
|
||||
*
|
||||
* Reading certain registers when the pipe is disabled can hang the chip.
|
||||
* Use this routine to make sure the PLL is running and the pipe is active
|
||||
* before reading such registers if unsure.
|
||||
*/
|
||||
static int
|
||||
i915_pipe_enabled(struct drm_device *dev, int pipe)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
/* Locking is horribly broken here, but whatever. */
|
||||
struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
|
||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
||||
|
||||
return intel_crtc->active;
|
||||
} else {
|
||||
return I915_READ(PIPECONF(pipe)) & PIPECONF_ENABLE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This timing diagram depicts the video signal in and
|
||||
* around the vertical blanking period.
|
||||
@@ -582,14 +557,6 @@ static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
|
||||
unsigned long high_frame;
|
||||
unsigned long low_frame;
|
||||
u32 high1, high2, low, pixel, vbl_start, hsync_start, htotal;
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe)) {
|
||||
DRM_DEBUG_DRIVER("trying to get vblank count for disabled "
|
||||
"pipe %c\n", pipe_name(pipe));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
struct intel_crtc *intel_crtc =
|
||||
to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
|
||||
const struct drm_display_mode *mode =
|
||||
@@ -600,16 +567,6 @@ static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
|
||||
vbl_start = mode->crtc_vblank_start;
|
||||
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
|
||||
vbl_start = DIV_ROUND_UP(vbl_start, 2);
|
||||
} else {
|
||||
enum transcoder cpu_transcoder = (enum transcoder) pipe;
|
||||
|
||||
htotal = ((I915_READ(HTOTAL(cpu_transcoder)) >> 16) & 0x1fff) + 1;
|
||||
hsync_start = (I915_READ(HSYNC(cpu_transcoder)) & 0x1fff) + 1;
|
||||
vbl_start = (I915_READ(VBLANK(cpu_transcoder)) & 0x1fff) + 1;
|
||||
if ((I915_READ(PIPECONF(cpu_transcoder)) &
|
||||
PIPECONF_INTERLACE_MASK) != PIPECONF_PROGRESSIVE)
|
||||
vbl_start = DIV_ROUND_UP(vbl_start, 2);
|
||||
}
|
||||
|
||||
/* Convert to pixel count */
|
||||
vbl_start *= htotal;
|
||||
@@ -648,12 +605,6 @@ static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
int reg = PIPE_FRMCOUNT_GM45(pipe);
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe)) {
|
||||
DRM_DEBUG_DRIVER("trying to get vblank count for disabled "
|
||||
"pipe %c\n", pipe_name(pipe));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return I915_READ(reg);
|
||||
}
|
||||
|
||||
@@ -840,7 +791,7 @@ static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!crtc->enabled) {
|
||||
if (!crtc->state->enable) {
|
||||
DRM_DEBUG_KMS("crtc %d is disabled\n", pipe);
|
||||
return -EBUSY;
|
||||
}
|
||||
@@ -2647,9 +2598,6 @@ static int i915_enable_vblank(struct drm_device *dev, int pipe)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
unsigned long irqflags;
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
|
||||
if (INTEL_INFO(dev)->gen >= 4)
|
||||
i915_enable_pipestat(dev_priv, pipe,
|
||||
@@ -2669,9 +2617,6 @@ static int ironlake_enable_vblank(struct drm_device *dev, int pipe)
|
||||
uint32_t bit = (INTEL_INFO(dev)->gen >= 7) ? DE_PIPE_VBLANK_IVB(pipe) :
|
||||
DE_PIPE_VBLANK(pipe);
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
|
||||
ironlake_enable_display_irq(dev_priv, bit);
|
||||
spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
|
||||
@@ -2684,9 +2629,6 @@ static int valleyview_enable_vblank(struct drm_device *dev, int pipe)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
unsigned long irqflags;
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
|
||||
i915_enable_pipestat(dev_priv, pipe,
|
||||
PIPE_START_VBLANK_INTERRUPT_STATUS);
|
||||
@@ -2700,9 +2642,6 @@ static int gen8_enable_vblank(struct drm_device *dev, int pipe)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
unsigned long irqflags;
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
|
||||
dev_priv->de_irq_mask[pipe] &= ~GEN8_PIPE_VBLANK;
|
||||
I915_WRITE(GEN8_DE_PIPE_IMR(pipe), dev_priv->de_irq_mask[pipe]);
|
||||
@@ -2754,9 +2693,6 @@ static void gen8_disable_vblank(struct drm_device *dev, int pipe)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
unsigned long irqflags;
|
||||
|
||||
if (!i915_pipe_enabled(dev, pipe))
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
|
||||
dev_priv->de_irq_mask[pipe] |= GEN8_PIPE_VBLANK;
|
||||
I915_WRITE(GEN8_DE_PIPE_IMR(pipe), dev_priv->de_irq_mask[pipe]);
|
||||
@@ -4368,10 +4304,8 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
|
||||
if (!IS_GEN2(dev_priv))
|
||||
dev->vblank_disable_immediate = true;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
|
||||
dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
|
||||
}
|
||||
|
||||
if (IS_CHERRYVIEW(dev_priv)) {
|
||||
dev->driver->irq_handler = cherryview_irq_handler;
|
||||
|
||||
@@ -139,6 +139,19 @@
|
||||
#define GEN8_RING_PDP_UDW(ring, n) ((ring)->mmio_base+0x270 + ((n) * 8 + 4))
|
||||
#define GEN8_RING_PDP_LDW(ring, n) ((ring)->mmio_base+0x270 + (n) * 8)
|
||||
|
||||
#define GEN8_R_PWR_CLK_STATE 0x20C8
|
||||
#define GEN8_RPCS_ENABLE (1 << 31)
|
||||
#define GEN8_RPCS_S_CNT_ENABLE (1 << 18)
|
||||
#define GEN8_RPCS_S_CNT_SHIFT 15
|
||||
#define GEN8_RPCS_S_CNT_MASK (0x7 << GEN8_RPCS_S_CNT_SHIFT)
|
||||
#define GEN8_RPCS_SS_CNT_ENABLE (1 << 11)
|
||||
#define GEN8_RPCS_SS_CNT_SHIFT 8
|
||||
#define GEN8_RPCS_SS_CNT_MASK (0x7 << GEN8_RPCS_SS_CNT_SHIFT)
|
||||
#define GEN8_RPCS_EU_MAX_SHIFT 4
|
||||
#define GEN8_RPCS_EU_MAX_MASK (0xf << GEN8_RPCS_EU_MAX_SHIFT)
|
||||
#define GEN8_RPCS_EU_MIN_SHIFT 0
|
||||
#define GEN8_RPCS_EU_MIN_MASK (0xf << GEN8_RPCS_EU_MIN_SHIFT)
|
||||
|
||||
#define GAM_ECOCHK 0x4090
|
||||
#define BDW_DISABLE_HDC_INVALIDATION (1<<25)
|
||||
#define ECOCHK_SNB_BIT (1<<10)
|
||||
@@ -1025,6 +1038,16 @@ enum skl_disp_power_wells {
|
||||
#define DPIO_CHV_PROP_COEFF_SHIFT 0
|
||||
#define CHV_PLL_DW6(ch) _PIPE(ch, _CHV_PLL_DW6_CH0, _CHV_PLL_DW6_CH1)
|
||||
|
||||
#define _CHV_PLL_DW8_CH0 0x8020
|
||||
#define _CHV_PLL_DW8_CH1 0x81A0
|
||||
#define CHV_PLL_DW8(ch) _PIPE(ch, _CHV_PLL_DW8_CH0, _CHV_PLL_DW8_CH1)
|
||||
|
||||
#define _CHV_PLL_DW9_CH0 0x8024
|
||||
#define _CHV_PLL_DW9_CH1 0x81A4
|
||||
#define DPIO_CHV_INT_LOCK_THRESHOLD_SHIFT 1 /* 3 bits */
|
||||
#define DPIO_CHV_INT_LOCK_THRESHOLD_SEL_COARSE 1 /* 1: coarse & 0 : fine */
|
||||
#define CHV_PLL_DW9(ch) _PIPE(ch, _CHV_PLL_DW9_CH0, _CHV_PLL_DW9_CH1)
|
||||
|
||||
#define _CHV_CMN_DW5_CH0 0x8114
|
||||
#define CHV_BUFRIGHTENA1_DISABLE (0 << 20)
|
||||
#define CHV_BUFRIGHTENA1_NORMAL (1 << 20)
|
||||
@@ -1328,6 +1351,8 @@ enum skl_disp_power_wells {
|
||||
#define GEN6_WIZ_HASHING_16x4 GEN6_WIZ_HASHING(1, 0)
|
||||
#define GEN6_WIZ_HASHING_MASK GEN6_WIZ_HASHING(1, 1)
|
||||
#define GEN6_TD_FOUR_ROW_DISPATCH_DISABLE (1 << 5)
|
||||
#define GEN9_IZ_HASHING_MASK(slice) (0x3 << (slice * 2))
|
||||
#define GEN9_IZ_HASHING(slice, val) ((val) << (slice * 2))
|
||||
|
||||
#define GFX_MODE 0x02520
|
||||
#define GFX_MODE_GEN7 0x0229c
|
||||
@@ -1506,6 +1531,17 @@ enum skl_disp_power_wells {
|
||||
#define CHV_FGT_EU_DIS_SS1_R1_SHIFT 28
|
||||
#define CHV_FGT_EU_DIS_SS1_R1_MASK (0xf << CHV_FGT_EU_DIS_SS1_R1_SHIFT)
|
||||
|
||||
#define GEN8_FUSE2 0x9120
|
||||
#define GEN8_F2_S_ENA_SHIFT 25
|
||||
#define GEN8_F2_S_ENA_MASK (0x7 << GEN8_F2_S_ENA_SHIFT)
|
||||
|
||||
#define GEN9_F2_SS_DIS_SHIFT 20
|
||||
#define GEN9_F2_SS_DIS_MASK (0xf << GEN9_F2_SS_DIS_SHIFT)
|
||||
|
||||
#define GEN8_EU_DISABLE0 0x9134
|
||||
#define GEN8_EU_DISABLE1 0x9138
|
||||
#define GEN8_EU_DISABLE2 0x913c
|
||||
|
||||
#define GEN6_BSD_SLEEP_PSMI_CONTROL 0x12050
|
||||
#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)
|
||||
#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)
|
||||
@@ -3880,6 +3916,7 @@ enum skl_disp_power_wells {
|
||||
#define PIPECONF_INTERLACE_MODE_MASK (7 << 21)
|
||||
#define PIPECONF_EDP_RR_MODE_SWITCH (1 << 20)
|
||||
#define PIPECONF_CXSR_DOWNCLOCK (1<<16)
|
||||
#define PIPECONF_EDP_RR_MODE_SWITCH_VLV (1 << 14)
|
||||
#define PIPECONF_COLOR_RANGE_SELECT (1 << 13)
|
||||
#define PIPECONF_BPC_MASK (0x7 << 5)
|
||||
#define PIPECONF_8BPC (0<<5)
|
||||
@@ -5248,6 +5285,7 @@ enum skl_disp_power_wells {
|
||||
|
||||
#define HIZ_CHICKEN 0x7018
|
||||
# define CHV_HZ_8X8_MODE_IN_1X (1<<15)
|
||||
# define BDW_HIZ_POWER_COMPILER_CLOCK_GATING_DISABLE (1<<3)
|
||||
|
||||
#define GEN9_SLICE_COMMON_ECO_CHICKEN0 0x7308
|
||||
#define DISABLE_PIXEL_MASK_CAMMING (1<<14)
|
||||
@@ -6187,6 +6225,26 @@ enum skl_disp_power_wells {
|
||||
#define GEN6_RC6 3
|
||||
#define GEN6_RC7 4
|
||||
|
||||
#define GEN9_SLICE0_PGCTL_ACK 0x804c
|
||||
#define GEN9_SLICE1_PGCTL_ACK 0x8050
|
||||
#define GEN9_SLICE2_PGCTL_ACK 0x8054
|
||||
#define GEN9_PGCTL_SLICE_ACK (1 << 0)
|
||||
|
||||
#define GEN9_SLICE0_SS01_EU_PGCTL_ACK 0x805c
|
||||
#define GEN9_SLICE0_SS23_EU_PGCTL_ACK 0x8060
|
||||
#define GEN9_SLICE1_SS01_EU_PGCTL_ACK 0x8064
|
||||
#define GEN9_SLICE1_SS23_EU_PGCTL_ACK 0x8068
|
||||
#define GEN9_SLICE2_SS01_EU_PGCTL_ACK 0x806c
|
||||
#define GEN9_SLICE2_SS23_EU_PGCTL_ACK 0x8070
|
||||
#define GEN9_PGCTL_SSA_EU08_ACK (1 << 0)
|
||||
#define GEN9_PGCTL_SSA_EU19_ACK (1 << 2)
|
||||
#define GEN9_PGCTL_SSA_EU210_ACK (1 << 4)
|
||||
#define GEN9_PGCTL_SSA_EU311_ACK (1 << 6)
|
||||
#define GEN9_PGCTL_SSB_EU08_ACK (1 << 8)
|
||||
#define GEN9_PGCTL_SSB_EU19_ACK (1 << 10)
|
||||
#define GEN9_PGCTL_SSB_EU210_ACK (1 << 12)
|
||||
#define GEN9_PGCTL_SSB_EU311_ACK (1 << 14)
|
||||
|
||||
#define GEN7_MISCCPCTL (0x9424)
|
||||
#define GEN7_DOP_CLOCK_GATE_ENABLE (1<<0)
|
||||
|
||||
|
||||
@@ -29,166 +29,6 @@
|
||||
#include "intel_drv.h"
|
||||
#include "i915_reg.h"
|
||||
|
||||
static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
I915_WRITE8(index_port, reg);
|
||||
return I915_READ8(data_port);
|
||||
}
|
||||
|
||||
static u8 i915_read_ar(struct drm_device *dev, u16 st01, u8 reg, u16 palette_enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
I915_READ8(st01);
|
||||
I915_WRITE8(VGA_AR_INDEX, palette_enable | reg);
|
||||
return I915_READ8(VGA_AR_DATA_READ);
|
||||
}
|
||||
|
||||
static void i915_write_ar(struct drm_device *dev, u16 st01, u8 reg, u8 val, u16 palette_enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
I915_READ8(st01);
|
||||
I915_WRITE8(VGA_AR_INDEX, palette_enable | reg);
|
||||
I915_WRITE8(VGA_AR_DATA_WRITE, val);
|
||||
}
|
||||
|
||||
static void i915_write_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg, u8 val)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
I915_WRITE8(index_port, reg);
|
||||
I915_WRITE8(data_port, val);
|
||||
}
|
||||
|
||||
static void i915_save_vga(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
int i;
|
||||
u16 cr_index, cr_data, st01;
|
||||
|
||||
/* VGA state */
|
||||
dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
|
||||
dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
|
||||
dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
|
||||
dev_priv->regfile.saveVGACNTRL = I915_READ(i915_vgacntrl_reg(dev));
|
||||
|
||||
/* VGA color palette registers */
|
||||
dev_priv->regfile.saveDACMASK = I915_READ8(VGA_DACMASK);
|
||||
|
||||
/* MSR bits */
|
||||
dev_priv->regfile.saveMSR = I915_READ8(VGA_MSR_READ);
|
||||
if (dev_priv->regfile.saveMSR & VGA_MSR_CGA_MODE) {
|
||||
cr_index = VGA_CR_INDEX_CGA;
|
||||
cr_data = VGA_CR_DATA_CGA;
|
||||
st01 = VGA_ST01_CGA;
|
||||
} else {
|
||||
cr_index = VGA_CR_INDEX_MDA;
|
||||
cr_data = VGA_CR_DATA_MDA;
|
||||
st01 = VGA_ST01_MDA;
|
||||
}
|
||||
|
||||
/* CRT controller regs */
|
||||
i915_write_indexed(dev, cr_index, cr_data, 0x11,
|
||||
i915_read_indexed(dev, cr_index, cr_data, 0x11) &
|
||||
(~0x80));
|
||||
for (i = 0; i <= 0x24; i++)
|
||||
dev_priv->regfile.saveCR[i] =
|
||||
i915_read_indexed(dev, cr_index, cr_data, i);
|
||||
/* Make sure we don't turn off CR group 0 writes */
|
||||
dev_priv->regfile.saveCR[0x11] &= ~0x80;
|
||||
|
||||
/* Attribute controller registers */
|
||||
I915_READ8(st01);
|
||||
dev_priv->regfile.saveAR_INDEX = I915_READ8(VGA_AR_INDEX);
|
||||
for (i = 0; i <= 0x14; i++)
|
||||
dev_priv->regfile.saveAR[i] = i915_read_ar(dev, st01, i, 0);
|
||||
I915_READ8(st01);
|
||||
I915_WRITE8(VGA_AR_INDEX, dev_priv->regfile.saveAR_INDEX);
|
||||
I915_READ8(st01);
|
||||
|
||||
/* Graphics controller registers */
|
||||
for (i = 0; i < 9; i++)
|
||||
dev_priv->regfile.saveGR[i] =
|
||||
i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, i);
|
||||
|
||||
dev_priv->regfile.saveGR[0x10] =
|
||||
i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x10);
|
||||
dev_priv->regfile.saveGR[0x11] =
|
||||
i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x11);
|
||||
dev_priv->regfile.saveGR[0x18] =
|
||||
i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x18);
|
||||
|
||||
/* Sequencer registers */
|
||||
for (i = 0; i < 8; i++)
|
||||
dev_priv->regfile.saveSR[i] =
|
||||
i915_read_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i);
|
||||
}
|
||||
|
||||
static void i915_restore_vga(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
int i;
|
||||
u16 cr_index, cr_data, st01;
|
||||
|
||||
/* VGA state */
|
||||
I915_WRITE(i915_vgacntrl_reg(dev), dev_priv->regfile.saveVGACNTRL);
|
||||
|
||||
I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
|
||||
I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
|
||||
I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
|
||||
POSTING_READ(VGA_PD);
|
||||
udelay(150);
|
||||
|
||||
/* MSR bits */
|
||||
I915_WRITE8(VGA_MSR_WRITE, dev_priv->regfile.saveMSR);
|
||||
if (dev_priv->regfile.saveMSR & VGA_MSR_CGA_MODE) {
|
||||
cr_index = VGA_CR_INDEX_CGA;
|
||||
cr_data = VGA_CR_DATA_CGA;
|
||||
st01 = VGA_ST01_CGA;
|
||||
} else {
|
||||
cr_index = VGA_CR_INDEX_MDA;
|
||||
cr_data = VGA_CR_DATA_MDA;
|
||||
st01 = VGA_ST01_MDA;
|
||||
}
|
||||
|
||||
/* Sequencer registers, don't write SR07 */
|
||||
for (i = 0; i < 7; i++)
|
||||
i915_write_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i,
|
||||
dev_priv->regfile.saveSR[i]);
|
||||
|
||||
/* CRT controller regs */
|
||||
/* Enable CR group 0 writes */
|
||||
i915_write_indexed(dev, cr_index, cr_data, 0x11, dev_priv->regfile.saveCR[0x11]);
|
||||
for (i = 0; i <= 0x24; i++)
|
||||
i915_write_indexed(dev, cr_index, cr_data, i, dev_priv->regfile.saveCR[i]);
|
||||
|
||||
/* Graphics controller regs */
|
||||
for (i = 0; i < 9; i++)
|
||||
i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, i,
|
||||
dev_priv->regfile.saveGR[i]);
|
||||
|
||||
i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x10,
|
||||
dev_priv->regfile.saveGR[0x10]);
|
||||
i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x11,
|
||||
dev_priv->regfile.saveGR[0x11]);
|
||||
i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x18,
|
||||
dev_priv->regfile.saveGR[0x18]);
|
||||
|
||||
/* Attribute controller registers */
|
||||
I915_READ8(st01); /* switch back to index mode */
|
||||
for (i = 0; i <= 0x14; i++)
|
||||
i915_write_ar(dev, st01, i, dev_priv->regfile.saveAR[i], 0);
|
||||
I915_READ8(st01); /* switch back to index mode */
|
||||
I915_WRITE8(VGA_AR_INDEX, dev_priv->regfile.saveAR_INDEX | 0x20);
|
||||
I915_READ8(st01);
|
||||
|
||||
/* VGA color palette registers */
|
||||
I915_WRITE8(VGA_DACMASK, dev_priv->regfile.saveDACMASK);
|
||||
}
|
||||
|
||||
static void i915_save_display(struct drm_device *dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
@@ -197,11 +37,6 @@ static void i915_save_display(struct drm_device *dev)
|
||||
if (INTEL_INFO(dev)->gen <= 4)
|
||||
dev_priv->regfile.saveDSPARB = I915_READ(DSPARB);
|
||||
|
||||
/* This is only meaningful in non-KMS mode */
|
||||
/* Don't regfile.save them in KMS mode */
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
i915_save_display_reg(dev);
|
||||
|
||||
/* LVDS state */
|
||||
if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
|
||||
dev_priv->regfile.saveLVDS = I915_READ(PCH_LVDS);
|
||||
@@ -224,9 +59,6 @@ static void i915_save_display(struct drm_device *dev)
|
||||
/* save FBC interval */
|
||||
if (HAS_FBC(dev) && INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev))
|
||||
dev_priv->regfile.saveFBC_CONTROL = I915_READ(FBC_CONTROL);
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
i915_save_vga(dev);
|
||||
}
|
||||
|
||||
static void i915_restore_display(struct drm_device *dev)
|
||||
@@ -238,10 +70,6 @@ static void i915_restore_display(struct drm_device *dev)
|
||||
if (INTEL_INFO(dev)->gen <= 4)
|
||||
I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB);
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
i915_restore_display_reg(dev);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
mask = ~LVDS_PORT_EN;
|
||||
|
||||
/* LVDS state */
|
||||
@@ -270,9 +98,6 @@ static void i915_restore_display(struct drm_device *dev)
|
||||
if (HAS_FBC(dev) && INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev))
|
||||
I915_WRITE(FBC_CONTROL, dev_priv->regfile.saveFBC_CONTROL);
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
i915_restore_vga(dev);
|
||||
else
|
||||
i915_redisable_vga(dev);
|
||||
}
|
||||
|
||||
@@ -285,24 +110,6 @@ int i915_save_state(struct drm_device *dev)
|
||||
|
||||
i915_save_display(dev);
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
/* Interrupt state */
|
||||
if (HAS_PCH_SPLIT(dev)) {
|
||||
dev_priv->regfile.saveDEIER = I915_READ(DEIER);
|
||||
dev_priv->regfile.saveDEIMR = I915_READ(DEIMR);
|
||||
dev_priv->regfile.saveGTIER = I915_READ(GTIER);
|
||||
dev_priv->regfile.saveGTIMR = I915_READ(GTIMR);
|
||||
dev_priv->regfile.saveFDI_RXA_IMR = I915_READ(_FDI_RXA_IMR);
|
||||
dev_priv->regfile.saveFDI_RXB_IMR = I915_READ(_FDI_RXB_IMR);
|
||||
dev_priv->regfile.saveMCHBAR_RENDER_STANDBY =
|
||||
I915_READ(RSTDBYCTL);
|
||||
dev_priv->regfile.savePCH_PORT_HOTPLUG = I915_READ(PCH_PORT_HOTPLUG);
|
||||
} else {
|
||||
dev_priv->regfile.saveIER = I915_READ(IER);
|
||||
dev_priv->regfile.saveIMR = I915_READ(IMR);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_GEN4(dev))
|
||||
pci_read_config_word(dev->pdev, GCDGMBUS,
|
||||
&dev_priv->regfile.saveGCDGMBUS);
|
||||
@@ -341,24 +148,6 @@ int i915_restore_state(struct drm_device *dev)
|
||||
dev_priv->regfile.saveGCDGMBUS);
|
||||
i915_restore_display(dev);
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
|
||||
/* Interrupt state */
|
||||
if (HAS_PCH_SPLIT(dev)) {
|
||||
I915_WRITE(DEIER, dev_priv->regfile.saveDEIER);
|
||||
I915_WRITE(DEIMR, dev_priv->regfile.saveDEIMR);
|
||||
I915_WRITE(GTIER, dev_priv->regfile.saveGTIER);
|
||||
I915_WRITE(GTIMR, dev_priv->regfile.saveGTIMR);
|
||||
I915_WRITE(_FDI_RXA_IMR, dev_priv->regfile.saveFDI_RXA_IMR);
|
||||
I915_WRITE(_FDI_RXB_IMR, dev_priv->regfile.saveFDI_RXB_IMR);
|
||||
I915_WRITE(PCH_PORT_HOTPLUG, dev_priv->regfile.savePCH_PORT_HOTPLUG);
|
||||
I915_WRITE(RSTDBYCTL,
|
||||
dev_priv->regfile.saveMCHBAR_RENDER_STANDBY);
|
||||
} else {
|
||||
I915_WRITE(IER, dev_priv->regfile.saveIER);
|
||||
I915_WRITE(IMR, dev_priv->regfile.saveIMR);
|
||||
}
|
||||
}
|
||||
|
||||
/* Cache mode state */
|
||||
if (INTEL_INFO(dev)->gen < 7)
|
||||
I915_WRITE(CACHE_MODE_0, dev_priv->regfile.saveCACHE_MODE_0 |
|
||||
|
||||
@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct drm_minor *dminor = dev_get_drvdata(kdev);
|
||||
u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
|
||||
return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
|
||||
static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
|
||||
static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
|
||||
static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
|
||||
static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
|
||||
|
||||
static struct attribute *rc6_attrs[] = {
|
||||
&dev_attr_rc6_enable.attr,
|
||||
@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
|
||||
.name = power_group_name,
|
||||
.attrs = rc6p_attrs
|
||||
};
|
||||
|
||||
static struct attribute *media_rc6_attrs[] = {
|
||||
&dev_attr_media_rc6_residency_ms.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute_group media_rc6_attr_group = {
|
||||
.name = power_group_name,
|
||||
.attrs = media_rc6_attrs
|
||||
};
|
||||
#endif
|
||||
|
||||
static int l3_access_valid(struct drm_device *dev, loff_t offset)
|
||||
@@ -487,38 +506,17 @@ static ssize_t gt_rp_mhz_show(struct device *kdev, struct device_attribute *attr
|
||||
struct drm_minor *minor = dev_to_drm_minor(kdev);
|
||||
struct drm_device *dev = minor->dev;
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
u32 val, rp_state_cap;
|
||||
ssize_t ret;
|
||||
u32 val;
|
||||
|
||||
ret = mutex_lock_interruptible(&dev->struct_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
intel_runtime_pm_get(dev_priv);
|
||||
rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
|
||||
intel_runtime_pm_put(dev_priv);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
if (attr == &dev_attr_gt_RP0_freq_mhz) {
|
||||
if (IS_VALLEYVIEW(dev))
|
||||
if (attr == &dev_attr_gt_RP0_freq_mhz)
|
||||
val = intel_gpu_freq(dev_priv, dev_priv->rps.rp0_freq);
|
||||
else
|
||||
val = intel_gpu_freq(dev_priv,
|
||||
((rp_state_cap & 0x0000ff) >> 0));
|
||||
} else if (attr == &dev_attr_gt_RP1_freq_mhz) {
|
||||
if (IS_VALLEYVIEW(dev))
|
||||
else if (attr == &dev_attr_gt_RP1_freq_mhz)
|
||||
val = intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq);
|
||||
else
|
||||
val = intel_gpu_freq(dev_priv,
|
||||
((rp_state_cap & 0x00ff00) >> 8));
|
||||
} else if (attr == &dev_attr_gt_RPn_freq_mhz) {
|
||||
if (IS_VALLEYVIEW(dev))
|
||||
else if (attr == &dev_attr_gt_RPn_freq_mhz)
|
||||
val = intel_gpu_freq(dev_priv, dev_priv->rps.min_freq);
|
||||
else
|
||||
val = intel_gpu_freq(dev_priv,
|
||||
((rp_state_cap & 0xff0000) >> 16));
|
||||
} else {
|
||||
BUG();
|
||||
}
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", val);
|
||||
}
|
||||
|
||||
@@ -627,6 +625,12 @@ void i915_setup_sysfs(struct drm_device *dev)
|
||||
if (ret)
|
||||
DRM_ERROR("RC6p residency sysfs setup failed\n");
|
||||
}
|
||||
if (IS_VALLEYVIEW(dev)) {
|
||||
ret = sysfs_merge_group(&dev->primary->kdev->kobj,
|
||||
&media_rc6_attr_group);
|
||||
if (ret)
|
||||
DRM_ERROR("Media RC6 residency sysfs setup failed\n");
|
||||
}
|
||||
#endif
|
||||
if (HAS_L3_DPF(dev)) {
|
||||
ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -662,6 +662,13 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
|
||||
edp_link_params->vswing);
|
||||
break;
|
||||
}
|
||||
|
||||
if (bdb->version >= 173) {
|
||||
uint8_t vswing;
|
||||
|
||||
vswing = (edp->edp_vswing_preemph >> (panel_type * 4)) & 0xF;
|
||||
dev_priv->vbt.edp_low_vswing = vswing == 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user