[Intel-gfx] [PATCH 2/2] drm/i915: Handle failure to kick out a conflicting fb driver

Jani Nikula jani.nikula at linux.intel.com
Tue Dec 17 08:33:27 CET 2013


On Mon, 16 Dec 2013, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  drivers/gpu/drm/i915/i915_dma.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 6364c503f97d..6de3a43e3acf 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1414,15 +1414,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
>  }
>  
>  #ifdef CONFIG_DRM_I915_FBDEV
> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  {
>  	struct apertures_struct *ap;
>  	struct pci_dev *pdev = dev_priv->dev->pdev;
>  	bool primary;
> +	int ret;
>  
>  	ap = alloc_apertures(1);
>  	if (!ap)
> -		return;
> +		return -ENOMEM;
>  
>  	ap->ranges[0].base = dev_priv->gtt.mappable_base;
>  	ap->ranges[0].size = dev_priv->gtt.mappable_end;
> @@ -1430,13 +1431,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  	primary =
>  		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
>  
> -	remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> +	ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>  
>  	kfree(ap);
> +
> +	return ret;
>  }
>  #else
> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  {
> +	return 0;
>  }
>  #endif
>  
> @@ -1552,8 +1556,13 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  	if (ret)
>  		goto out_regs;
>  
> -	if (drm_core_check_feature(dev, DRIVER_MODESET))
> -		i915_kick_out_firmware_fb(dev_priv);
> +	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
> +		ret = i915_kick_out_firmware_fb(dev_priv);
> +		if (ret) {
> +			DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> +			goto out_gtt;
> +		}
> +	}
>  
>  	pci_set_master(dev->pdev);
>  
> -- 
> 1.8.5.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center



More information about the Intel-gfx mailing list