Re: [PATCH] drm/i915: Correctly refcount connectors in hw state readou

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 06, 2016 at 03:09:43PM +0200, Daniel Vetter wrote:
> This was forgotten when adding the the refcounting to
> drm_connector_state.
> 
> Cc: Gabriel Feceoru <gabriel.feceoru@xxxxxxxxx>
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Marius Vlad <marius.c.vlad@xxxxxxxxx>
> Cc: Dave Airlie <airlied@xxxxxxxxxx>
> Fixes: d2307dea14a4 ("drm/atomic: use connector references (v3)")
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 45c218db86be..d26429c77c10 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12028,6 +12028,8 @@ static void intel_modeset_update_connector_atomic_state(struct drm_device *dev)
>  				connector->base.encoder;
>  			connector->base.state->crtc =
>  				connector->base.encoder->crtc;
> +
> +			drm_connector_reference(&connector->base);

Right that matches d2307dea14a4 but do we have to worry about balance
here?

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8ae5a8ac3b7b..49c4f5e77d32 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11947,14 +11947,18 @@ static void intel_modeset_update_connector_atomic_state(struct drm_device *dev)
        struct intel_connector *connector;
 
        for_each_intel_connector(dev, connector) {
+               if (connector->base.state->crtc) {
+                       connector->base.state->best_encoder = NULL;
+                       connector->base.state->crtc = NULL;
+                       drm_connector_unreference(&connector->base);
+               }
+
                if (connector->base.encoder) {
-                       connector->base.state->best_encoder =
-                               connector->base.encoder;
+                       drm_connector_reference(&connector->base);
                        connector->base.state->crtc =
                                connector->base.encoder->crtc;
-               } else {
-                       connector->base.state->best_encoder = NULL;
-                       connector->base.state->crtc = NULL;
+                       connector->base.state->best_encoder =
+                               connector->base.encoder;
                }
        }
 }


-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux