Skip to content

Commit

Permalink
Merge tag 'drm-intel-next-fixes-2023-02-27' of git://anongit.freedesk…
Browse files Browse the repository at this point in the history
…top.org/drm/drm-intel into drm-next

drm/i915 fixes for v6.3-rc1:
- Don't use stolen memory or BAR mappings for ring buffers with LLC
- Add inverted backlight quirk for HP 14-r206nv
- Fix GSI offset for MCR lookups
- GVT fixes (memleak, debugfs attributes, kconfig, typos)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87cz5v2z0j.fsf@intel.com
  • Loading branch information
Dave Airlie committed Mar 2, 2023
2 parents 3d3921d + 5d2fdb2 commit 7b7d242
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 18 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ config DRM_I915_USERPTR

If in doubt, say "Y".

config DRM_I915_GVT
bool

config DRM_I915_GVT_KVMGT
tristate "Enable KVM host support Intel GVT-g graphics virtualization"
depends on DRM_I915
Expand Down Expand Up @@ -171,3 +168,6 @@ menu "drm/i915 Unstable Evolution"
depends on DRM_I915
source "drivers/gpu/drm/i915/Kconfig.unstable"
endmenu

config DRM_I915_GVT
bool
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/display/intel_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ static struct intel_quirk intel_quirks[] = {
/* ECS Liva Q2 */
{ 0x3185, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time },
{ 0x3184, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time },
/* HP Notebook - 14-r206nv */
{ 0x0f31, 0x103c, 0x220f, quirk_invert_brightness },
};

void intel_init_quirks(struct drm_i915_private *i915)
Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/i915/gt/intel_gt_mcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,15 @@ static bool reg_needs_read_steering(struct intel_gt *gt,
i915_mcr_reg_t reg,
enum intel_steering_type type)
{
const u32 offset = i915_mmio_reg_offset(reg);
u32 offset = i915_mmio_reg_offset(reg);
const struct intel_mmio_range *entry;

if (likely(!gt->steering_table[type]))
return false;

if (IS_GSI_REG(offset))
offset += gt->uncore->gsi_offset;

for (entry = gt->steering_table[type]; entry->end; entry++) {
if (offset >= entry->start && offset <= entry->end)
return true;
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/gt/intel_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)
if (unlikely(ret))
goto err_unpin;

if (i915_vma_is_map_and_fenceable(vma)) {
if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915)) {
addr = (void __force *)i915_vma_pin_iomap(vma);
} else {
int type = i915_coherent_map_type(vma->vm->i915, vma->obj, false);
Expand Down Expand Up @@ -98,7 +98,7 @@ void intel_ring_unpin(struct intel_ring *ring)
return;

i915_vma_unset_ggtt_write(vma);
if (i915_vma_is_map_and_fenceable(vma))
if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915))
i915_vma_unpin_iomap(vma);
else
i915_gem_object_unpin_map(vma->obj);
Expand All @@ -116,7 +116,7 @@ static struct i915_vma *create_ring_vma(struct i915_ggtt *ggtt, int size)

obj = i915_gem_object_create_lmem(i915, size, I915_BO_ALLOC_VOLATILE |
I915_BO_ALLOC_PM_VOLATILE);
if (IS_ERR(obj) && i915_ggtt_has_aperture(ggtt))
if (IS_ERR(obj) && i915_ggtt_has_aperture(ggtt) && !HAS_LLC(i915))
obj = i915_gem_object_create_stolen(i915, size);
if (IS_ERR(obj))
obj = i915_gem_object_create_internal(i915, size);
Expand Down
16 changes: 8 additions & 8 deletions drivers/gpu/drm/i915/gvt/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ vgpu_scan_nonprivbb_set(void *data, u64 val)
return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
"0x%llx\n");
DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
"0x%llx\n");

static int vgpu_status_get(void *data, u64 *val)
{
Expand All @@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");

/**
* intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
Expand All @@ -180,10 +180,10 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)

debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu,
&vgpu_mmio_diff_fops);
debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
&vgpu_scan_nonprivbb_fops);
debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
&vgpu_status_fops);
debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
&vgpu_scan_nonprivbb_fops);
debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
&vgpu_status_fops);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gvt/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int verify_firmware(struct intel_gvt *gvt,
mem = (fw->data + h->cfg_space_offset);

id = *(u16 *)(mem + PCI_VENDOR_ID);
VERIFY("vender id", id, pdev->vendor);
VERIFY("vendor id", id, pdev->vendor);

id = *(u16 *)(mem + PCI_DEVICE_ID);
VERIFY("device id", id, pdev->device);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gvt/kvmgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static void intel_vgpu_close_device(struct vfio_device *vfio_dev)

clear_bit(INTEL_VGPU_STATUS_ATTACHED, vgpu->status);

debugfs_remove(debugfs_lookup(KVMGT_DEBUGFS_FILENAME, vgpu->debugfs));
debugfs_lookup_and_remove(KVMGT_DEBUGFS_FILENAME, vgpu->debugfs);

kvm_page_track_unregister_notifier(vgpu->vfio_device.kvm,
&vgpu->track_node);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gvt/vgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ int intel_gvt_create_vgpu(struct intel_vgpu *vgpu,
ret = idr_alloc(&gvt->vgpu_idr, vgpu, IDLE_VGPU_IDR + 1, GVT_MAX_VGPU,
GFP_KERNEL);
if (ret < 0)
goto out_unlock;;
goto out_unlock;

vgpu->id = ret;
vgpu->sched_ctl.weight = conf->weight;
Expand Down

0 comments on commit 7b7d242

Please sign in to comment.