[Intel-gfx] [PATCH 1/2] drm/i915: Propagate PCI read/write errors during vga_set_state()
Jani Nikula
jani.nikula at linux.intel.com
Tue Dec 17 10:14:32 CET 2013
On Mon, 16 Dec 2013, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> This has very little effect other than log the errors in case of failure,
> and we then hope for the best.
Reviewed-by: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index d0082a025c83..7db292c469af 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11336,12 +11336,21 @@ int intel_modeset_vga_set_state(struct drm_device *dev, bool state)
> struct drm_i915_private *dev_priv = dev->dev_private;
> u16 gmch_ctrl;
>
> - pci_read_config_word(dev_priv->bridge_dev, INTEL_GMCH_CTRL, &gmch_ctrl);
> + if (pci_read_config_word(dev_priv->bridge_dev, INTEL_GMCH_CTRL, &gmch_ctrl)) {
> + DRM_ERROR("failed to read control word\n");
> + return -EIO;
> + }
> +
> if (state)
> gmch_ctrl &= ~INTEL_GMCH_VGA_DISABLE;
> else
> gmch_ctrl |= INTEL_GMCH_VGA_DISABLE;
> - pci_write_config_word(dev_priv->bridge_dev, INTEL_GMCH_CTRL, gmch_ctrl);
> +
> + if (pci_write_config_word(dev_priv->bridge_dev, INTEL_GMCH_CTRL, gmch_ctrl)) {
> + DRM_ERROR("failed to write control word\n");
> + return -EIO;
> + }
> +
> return 0;
> }
>
> --
> 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