]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'topic/drm-misc-2015-05-06' of git://anongit.freedesktop.org/drm-intel...
authorDave Airlie <airlied@redhat.com>
Thu, 7 May 2015 03:02:39 +0000 (13:02 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 7 May 2015 03:02:39 +0000 (13:02 +1000)
misc drm core patches.

* tag 'topic/drm-misc-2015-05-06' of git://anongit.freedesktop.org/drm-intel:
  drm: simplify master cleanup
  drm: simplify authentication management
  drm: drop unused 'magicfree' list
  drm: fix a memleak on mutex failure path
  drm/atomic-helper: Really recover pre-atomic plane/cursor behavior
  drm/qxl: Fix qxl_noop_get_vblank_counter()
  drm: Zero out invalid vblank timestamp in drm_update_vblank_count. (v2)
  drm: Prevent invalid use of vblank_disable_immediate. (v2)
  drm/vblank: Fixup and document timestamp update/read barriers
  DRM: Don't re-poll connector for disconnect
  drm: Fix for DP CTS test 4.2.2.5 - I2C DEFER handling
  drm: Fix the 'native defer' message in drm_dp_i2c_do_msg()
  drm/atomic-helper: Don't call atomic_update_plane when it stays off

1  2 
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_probe_helper.c

index 1d2ca52530d5f3148fec55d72d22c79f2eaa8949,9f216ff61af32646bb3d036e889b97bea9beaddf..5d30592c83cd7e7fdfe23e01226a8ca1c9fe6695
@@@ -1138,7 -1138,8 +1138,8 @@@ void drm_atomic_helper_commit_planes(st
                if (drm_atomic_plane_disabling(plane, old_plane_state) &&
                    funcs->atomic_disable)
                        funcs->atomic_disable(plane, old_plane_state);
-               else
+               else if (plane->state->crtc ||
+                        drm_atomic_plane_disabling(plane, old_plane_state))
                        funcs->atomic_update(plane, old_plane_state);
        }
  
@@@ -1309,13 -1310,13 +1310,13 @@@ retry
        plane_state->src_h = src_h;
        plane_state->src_w = src_w;
  
+       if (plane == crtc->cursor)
+               state->legacy_cursor_update = true;
        ret = drm_atomic_commit(state);
        if (ret != 0)
                goto fail;
  
-       if (plane == crtc->cursor)
-               state->legacy_cursor_update = true;
        /* Driver takes ownership of state on successful commit. */
        return 0;
  fail:
@@@ -1965,26 -1966,6 +1966,26 @@@ void drm_atomic_helper_crtc_reset(struc
  }
  EXPORT_SYMBOL(drm_atomic_helper_crtc_reset);
  
 +/**
 + * __drm_atomic_helper_crtc_duplicate_state - copy atomic CRTC state
 + * @crtc: CRTC object
 + * @state: atomic CRTC state
 + *
 + * Copies atomic state from a CRTC's current state and resets inferred values.
 + * This is useful for drivers that subclass the CRTC state.
 + */
 +void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
 +                                            struct drm_crtc_state *state)
 +{
 +      memcpy(state, crtc->state, sizeof(*state));
 +
 +      state->mode_changed = false;
 +      state->active_changed = false;
 +      state->planes_changed = false;
 +      state->event = NULL;
 +}
 +EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state);
 +
  /**
   * drm_atomic_helper_crtc_duplicate_state - default state duplicate hook
   * @crtc: drm CRTC
@@@ -2000,34 -1981,19 +2001,34 @@@ drm_atomic_helper_crtc_duplicate_state(
        if (WARN_ON(!crtc->state))
                return NULL;
  
 -      state = kmemdup(crtc->state, sizeof(*crtc->state), GFP_KERNEL);
 -
 -      if (state) {
 -              state->mode_changed = false;
 -              state->active_changed = false;
 -              state->planes_changed = false;
 -              state->event = NULL;
 -      }
 +      state = kmalloc(sizeof(*state), GFP_KERNEL);
 +      if (state)
 +              __drm_atomic_helper_crtc_duplicate_state(crtc, state);
  
        return state;
  }
  EXPORT_SYMBOL(drm_atomic_helper_crtc_duplicate_state);
  
 +/**
 + * __drm_atomic_helper_crtc_destroy_state - release CRTC state
 + * @crtc: CRTC object
 + * @state: CRTC state object to release
 + *
 + * Releases all resources stored in the CRTC state without actually freeing
 + * the memory of the CRTC state. This is useful for drivers that subclass the
 + * CRTC state.
 + */
 +void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
 +                                          struct drm_crtc_state *state)
 +{
 +      /*
 +       * This is currently a placeholder so that drivers that subclass the
 +       * state will automatically do the right thing if code is ever added
 +       * to this function.
 +       */
 +}
 +EXPORT_SYMBOL(__drm_atomic_helper_crtc_destroy_state);
 +
  /**
   * drm_atomic_helper_crtc_destroy_state - default state destroy hook
   * @crtc: drm CRTC
  void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
                                          struct drm_crtc_state *state)
  {
 +      __drm_atomic_helper_crtc_destroy_state(crtc, state);
        kfree(state);
  }
  EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
@@@ -2064,24 -2029,6 +2065,24 @@@ void drm_atomic_helper_plane_reset(stru
  }
  EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
  
 +/**
 + * __drm_atomic_helper_plane_duplicate_state - copy atomic plane state
 + * @plane: plane object
 + * @state: atomic plane state
 + *
 + * Copies atomic state from a plane's current state. This is useful for
 + * drivers that subclass the plane state.
 + */
 +void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
 +                                             struct drm_plane_state *state)
 +{
 +      memcpy(state, plane->state, sizeof(*state));
 +
 +      if (state->fb)
 +              drm_framebuffer_reference(state->fb);
 +}
 +EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state);
 +
  /**
   * drm_atomic_helper_plane_duplicate_state - default state duplicate hook
   * @plane: drm plane
@@@ -2097,31 -2044,15 +2098,31 @@@ drm_atomic_helper_plane_duplicate_state
        if (WARN_ON(!plane->state))
                return NULL;
  
 -      state = kmemdup(plane->state, sizeof(*plane->state), GFP_KERNEL);
 -
 -      if (state && state->fb)
 -              drm_framebuffer_reference(state->fb);
 +      state = kmalloc(sizeof(*state), GFP_KERNEL);
 +      if (state)
 +              __drm_atomic_helper_plane_duplicate_state(plane, state);
  
        return state;
  }
  EXPORT_SYMBOL(drm_atomic_helper_plane_duplicate_state);
  
 +/**
 + * __drm_atomic_helper_plane_destroy_state - release plane state
 + * @plane: plane object
 + * @state: plane state object to release
 + *
 + * Releases all resources stored in the plane state without actually freeing
 + * the memory of the plane state. This is useful for drivers that subclass the
 + * plane state.
 + */
 +void __drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
 +                                           struct drm_plane_state *state)
 +{
 +      if (state->fb)
 +              drm_framebuffer_unreference(state->fb);
 +}
 +EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state);
 +
  /**
   * drm_atomic_helper_plane_destroy_state - default state destroy hook
   * @plane: drm plane
  void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
                                           struct drm_plane_state *state)
  {
 -      if (state->fb)
 -              drm_framebuffer_unreference(state->fb);
 -
 +      __drm_atomic_helper_plane_destroy_state(plane, state);
        kfree(state);
  }
  EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state);
@@@ -2156,22 -2089,6 +2157,22 @@@ void drm_atomic_helper_connector_reset(
  }
  EXPORT_SYMBOL(drm_atomic_helper_connector_reset);
  
 +/**
 + * __drm_atomic_helper_connector_duplicate_state - copy atomic connector state
 + * @connector: connector object
 + * @state: atomic connector state
 + *
 + * Copies atomic state from a connector's current state. This is useful for
 + * drivers that subclass the connector state.
 + */
 +void
 +__drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
 +                                          struct drm_connector_state *state)
 +{
 +      memcpy(state, connector->state, sizeof(*state));
 +}
 +EXPORT_SYMBOL(__drm_atomic_helper_connector_duplicate_state);
 +
  /**
   * drm_atomic_helper_connector_duplicate_state - default state duplicate hook
   * @connector: drm connector
  struct drm_connector_state *
  drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector)
  {
 +      struct drm_connector_state *state;
 +
        if (WARN_ON(!connector->state))
                return NULL;
  
 -      return kmemdup(connector->state, sizeof(*connector->state), GFP_KERNEL);
 +      state = kmalloc(sizeof(*state), GFP_KERNEL);
 +      if (state)
 +              __drm_atomic_helper_connector_duplicate_state(connector, state);
 +
 +      return state;
  }
  EXPORT_SYMBOL(drm_atomic_helper_connector_duplicate_state);
  
 +/**
 + * __drm_atomic_helper_connector_destroy_state - release connector state
 + * @connector: connector object
 + * @state: connector state object to release
 + *
 + * Releases all resources stored in the connector state without actually
 + * freeing the memory of the connector state. This is useful for drivers that
 + * subclass the connector state.
 + */
 +void
 +__drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
 +                                          struct drm_connector_state *state)
 +{
 +      /*
 +       * This is currently a placeholder so that drivers that subclass the
 +       * state will automatically do the right thing if code is ever added
 +       * to this function.
 +       */
 +}
 +EXPORT_SYMBOL(__drm_atomic_helper_connector_destroy_state);
 +
  /**
   * drm_atomic_helper_connector_destroy_state - default state destroy hook
   * @connector: drm connector
  void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
                                          struct drm_connector_state *state)
  {
 +      __drm_atomic_helper_connector_destroy_state(connector, state);
        kfree(state);
  }
  EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
index 63503879a676cc07db6c417cad49017b02a59ca8,2fb2fbe8c2de52f68da7fbb3301bd0d85f060037..04203c0d2ecbe0c2a73bc0a5909f9ef85f533baa
@@@ -174,7 -174,6 +174,7 @@@ static int drm_helper_probe_single_conn
                        struct edid *edid = (struct edid *) connector->edid_blob_ptr->data;
  
                        count = drm_add_edid_modes(connector, edid);
 +                      drm_edid_to_eld(connector, edid);
                } else
                        count = (*connector_funcs->get_modes)(connector);
        }
@@@ -323,8 -322,6 +323,6 @@@ static void output_poll_execute(struct 
                if (!connector->polled || connector->polled == DRM_CONNECTOR_POLL_HPD)
                        continue;
  
-               repoll = true;
                old_status = connector->status;
                /* if we are connected and don't want to poll for disconnect
                   skip it */
                    !(connector->polled & DRM_CONNECTOR_POLL_DISCONNECT))
                        continue;
  
+               repoll = true;
                connector->status = connector->funcs->detect(connector, false);
                if (old_status != connector->status) {
                        const char *old, *new;