Commit f3231a02 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2020-09-24' of...

Merge tag 'drm-intel-fixes-2020-09-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

drm/i915 fixes for v5.9-rc7:
- Fix selftest reference to stack data out of scope
- Fix GVT null pointer dereference
- Backmerge from Linus' master to fix build
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87zh5fpmha.fsf@intel.com
parents 720777c5 16cce04c
...@@ -368,6 +368,7 @@ void intel_gvt_destroy_idle_vgpu(struct intel_vgpu *vgpu) ...@@ -368,6 +368,7 @@ void intel_gvt_destroy_idle_vgpu(struct intel_vgpu *vgpu)
static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt, static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
struct intel_vgpu_creation_params *param) struct intel_vgpu_creation_params *param)
{ {
struct drm_i915_private *dev_priv = gvt->gt->i915;
struct intel_vgpu *vgpu; struct intel_vgpu *vgpu;
int ret; int ret;
...@@ -436,6 +437,9 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt, ...@@ -436,6 +437,9 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
if (ret) if (ret)
goto out_clean_sched_policy; goto out_clean_sched_policy;
if (IS_BROADWELL(dev_priv))
ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_B);
else
ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D); ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D);
if (ret) if (ret)
goto out_clean_sched_policy; goto out_clean_sched_policy;
......
...@@ -118,11 +118,11 @@ static struct dev_pm_domain pm_domain = { ...@@ -118,11 +118,11 @@ static struct dev_pm_domain pm_domain = {
struct drm_i915_private *mock_gem_device(void) struct drm_i915_private *mock_gem_device(void)
{ {
struct drm_i915_private *i915;
struct pci_dev *pdev;
#if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU) #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
struct dev_iommu iommu; static struct dev_iommu fake_iommu = { .priv = (void *)-1 };
#endif #endif
struct drm_i915_private *i915;
struct pci_dev *pdev;
int err; int err;
pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
...@@ -141,10 +141,8 @@ struct drm_i915_private *mock_gem_device(void) ...@@ -141,10 +141,8 @@ struct drm_i915_private *mock_gem_device(void)
dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
#if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU) #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU)
/* HACK HACK HACK to disable iommu for the fake device; force identity mapping */ /* HACK to disable iommu for the fake device; force identity mapping */
memset(&iommu, 0, sizeof(iommu)); pdev->dev.iommu = &fake_iommu;
iommu.priv = (void *)-1;
pdev->dev.iommu = &iommu;
#endif #endif
pci_set_drvdata(pdev, i915); pci_set_drvdata(pdev, i915);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment