Commit 574ec42e authored by Linus Torvalds's avatar Linus Torvalds

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

Pull drm fixes from Dave Airlie:
 "Fairly quiet, a couple of i915 fixes, one dma-buf fix, one vc4 and two
  sun4i changes

  dma-buf:
   - Single null pointer deref fix

  i915:
   - Fix selftest reference to stack data out of scope
   - Fix GVT null pointer dereference

  vc4:
   - fill asoc card owner

  sun4i:
   - program secondary CSC correctly"

* tag 'drm-fixes-2020-09-25' of git://anongit.freedesktop.org/drm/drm:
  drm/i915/selftests: Push the fake iommu device from the stack to data
  dmabuf: fix NULL pointer dereference in dma_buf_release()
  drm/i915/gvt: Fix port number for BDW on EDID region setup
  drm/sun4i: mixer: Extend regmap max_register
  drm/sun4i: sun8i-csc: Secondary CSC register correction
  drm/vc4/vc4_hdmi: fill ASoC card owner
parents 171d4ff7 ba78755e
...@@ -59,6 +59,8 @@ static void dma_buf_release(struct dentry *dentry) ...@@ -59,6 +59,8 @@ static void dma_buf_release(struct dentry *dentry)
struct dma_buf *dmabuf; struct dma_buf *dmabuf;
dmabuf = dentry->d_fsdata; dmabuf = dentry->d_fsdata;
if (unlikely(!dmabuf))
return;
BUG_ON(dmabuf->vmapping_counter); BUG_ON(dmabuf->vmapping_counter);
......
...@@ -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,7 +437,10 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt, ...@@ -436,7 +437,10 @@ 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;
ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D); if (IS_BROADWELL(dev_priv))
ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_B);
else
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);
......
...@@ -12,7 +12,7 @@ struct sun8i_mixer; ...@@ -12,7 +12,7 @@ struct sun8i_mixer;
/* VI channel CSC units offsets */ /* VI channel CSC units offsets */
#define CCSC00_OFFSET 0xAA050 #define CCSC00_OFFSET 0xAA050
#define CCSC01_OFFSET 0xFA000 #define CCSC01_OFFSET 0xFA050
#define CCSC10_OFFSET 0xA0000 #define CCSC10_OFFSET 0xA0000
#define CCSC11_OFFSET 0xF0000 #define CCSC11_OFFSET 0xF0000
......
...@@ -307,7 +307,7 @@ static struct regmap_config sun8i_mixer_regmap_config = { ...@@ -307,7 +307,7 @@ static struct regmap_config sun8i_mixer_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
.max_register = 0xbfffc, /* guessed */ .max_register = 0xffffc, /* guessed */
}; };
static int sun8i_mixer_of_get_id(struct device_node *node) static int sun8i_mixer_of_get_id(struct device_node *node)
......
...@@ -1117,6 +1117,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi) ...@@ -1117,6 +1117,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi)
card->num_links = 1; card->num_links = 1;
card->name = "vc4-hdmi"; card->name = "vc4-hdmi";
card->dev = dev; card->dev = dev;
card->owner = THIS_MODULE;
/* /*
* Be careful, snd_soc_register_card() calls dev_set_drvdata() and * Be careful, snd_soc_register_card() calls dev_set_drvdata() and
......
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