From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Handle failure to kick out a conflicting fb driver
Date: Tue, 17 Dec 2013 09:33:27 +0200 [thread overview]
Message-ID: <8761qo3pa0.fsf@intel.com> (raw)
In-Reply-To: <1387209460-9042-2-git-send-email-chris@chris-wilson.co.uk>
On Mon, 16 Dec 2013, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jani Nikula <jani.nikula@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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2013-12-17 7:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 15:57 [PATCH 1/2] video/fb: Propagate error code from failing to unregister conflicting fb Chris Wilson
2013-12-16 15:57 ` [PATCH 2/2] drm/i915: Handle failure to kick out a conflicting fb driver Chris Wilson
2013-12-17 7:33 ` Jani Nikula [this message]
2014-07-14 15:15 ` Daniel Vetter
2013-12-17 7:33 ` [Intel-gfx] [PATCH 1/2] video/fb: Propagate error code from failing to unregister conflicting fb Jani Nikula
2013-12-17 12:14 ` Chris Wilson
2013-12-18 0:56 ` [Intel-gfx] " Dave Airlie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761qo3pa0.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox