1. 27 1月, 2015 5 次提交
    • M
      drm/i915: Add atomic_get_property entrypoint for connectors (v2) · 2545e4a6
      Matt Roper 提交于
      Even though we only support atomic plane updates at the moment, we still
      need to add an .atomic_get_property() entrypoint for connectors before
      we allow the driver to flip on the DRIVER_ATOMIC bit.  As soon as that
      bit gets set, the DRM core will start adding atomic connector properties
      (in addition to the plane properties we care about at the moment), so we
      need to be able to handle the new way the DRM core will interact with
      us.
      
      For simplicity, we just lookup driver-specific connector properties in
      the usual shadow array maintained by the core.  Once we get real atomic
      modeset support for crtc's and planes, this code should be re-written to
      pull the data out of crtc/connector state structures.
      
      v2: Fix intel_dvo and intel_dsi that I missed on the first pass (Ander)
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2545e4a6
    • M
      drm/i915: Setup dummy atomic state for connectors (v3) · c6f95f27
      Matt Roper 提交于
      We want to enable/test plane updates via the atomic interface, but as
      soon as we flip DRIVER_ATOMIC on, the DRM core will take some atomic
      codepaths to lookup properties during drmModeGetConnector() and some of
      those codepaths unconditionally dereference connector->state
      (specifically when looking up the CRTC ID property in
      drm_atomic_connector_get_property()).  Create a dummy connector state
      for each connector at init time to ensure the DRM core doesn't try to
      dereference a NULL connector->state.  The actual connector properties
      will never be updated or contain useful information, but since we're
      doing this specifically for testing/debug of the plane operations (and
      only when a specific kernel module option is given), that shouldn't
      really matter.
      
      Once we start creating connector states, the DRM core will want to be
      able to clean them up for us.  We also need to hook up the destruction
      entrypoint to the core's helper.
      
      v2: Squash in the patch to set the state destruction hook (Ander & Bob)
      
      v3: Only create dummy connector states when we're actually faking
          atomic support.  (Ander)
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c6f95f27
    • A
      drm/i915: Make intel_crtc->config a pointer · 6e3c9717
      Ander Conselvan de Oliveira 提交于
      To match the semantics of drm_crtc->state, which this will eventually
      become. The allocation of the memory for config will be fixed in a
      followup patch. By adding the extra _config field to intel_crtc it was
      possible to generate this entire patch with the cocci script below.
      
      @@ @@
      struct intel_crtc {
      ...
      -struct intel_crtc_state config;
      +struct intel_crtc_state _config;
      +struct intel_crtc_state *config;
      ...
      }
      @@ struct intel_crtc *crtc; @@
      -memset(&crtc->config, 0, sizeof(crtc->config));
      +memset(crtc->config, 0, sizeof(*crtc->config));
      @@ @@
      __intel_set_mode(...) {
      <...
      -to_intel_crtc(crtc)->config = *pipe_config;
      +(*(to_intel_crtc(crtc)->config)) = *pipe_config;
      ...>
      }
      @@ @@
      intel_crtc_init(...) {
      ...
      WARN_ON(drm_crtc_index(&intel_crtc->base) != intel_crtc->pipe);
      +intel_crtc->config = &intel_crtc->_config;
      return;
      ...
      }
      @@ struct intel_crtc *crtc; @@
      -&crtc->config
      +crtc->config
      @@ struct intel_crtc *crtc; identifier member; @@
      -crtc->config.member
      +crtc->config->member
      @@ expression E; @@
      -&(to_intel_crtc(E)->config)
      +to_intel_crtc(E)->config
      @@ expression E; identifier member; @@
      -to_intel_crtc(E)->config.member
      +to_intel_crtc(E)->config->member
      
      v2: Clarify manual changes by splitting them into another patch. (Matt)
          Improve cocci script to generate even more of the changes. (Ander)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6e3c9717
    • A
      drm/i915: Embedded struct drm_crtc_state in intel_crtc_state · 2d112de7
      Ander Conselvan de Oliveira 提交于
      And get rid of the duplicate mode structures. This patch was generated
      with the following semantic patch:
      
      @@ @@
      struct intel_crtc_state {
      +struct drm_crtc_state base;
      +
      ...
      -struct drm_display_mode requested_mode;
      -struct drm_display_mode adjusted_mode;
      ...
      }
      @@ struct intel_crtc_state *state; @@
      -state->adjusted_mode
      +state->base.adjusted_mode
      @@ struct intel_crtc_state *state; @@
      -state->requested_mode
      +state->base.mode
      @@ struct intel_crtc_state state; @@
      -state.adjusted_mode
      +state.base.adjusted_mode
      @@ struct intel_crtc_state state; @@
      -state.requested_mode
      +state.base.mode
      @@ struct drm_crtc *crtc; @@
      -to_intel_crtc(crtc)->config.adjusted_mode
      +to_intel_crtc(crtc)->config.base.adjusted_mode
      @@ identifier member; expression E; @@
      -PIPE_CONF_CHECK_FLAGS(adjusted_mode.member, E);
      +PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.member, E);
      @@ identifier member; @@
      -PIPE_CONF_CHECK_I(adjusted_mode.member);
      +PIPE_CONF_CHECK_I(base.adjusted_mode.member);
      @@ identifier member; @@
      -PIPE_CONF_CHECK_CLOCK_FUZZY(adjusted_mode.member);
      +PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.member);
      
      v2: Completely generate the patch with cocci. (Ander)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2d112de7
    • A
      drm/i915: Rename struct intel_crtc_config to intel_crtc_state · 5cec258b
      Ander Conselvan de Oliveira 提交于
      The objective is to make this structure usable with the atomic helpers,
      so let's start with the rename. Patch generated with coccinelle:
      
      @@ @@
      -struct intel_crtc_config {
      +struct intel_crtc_state {
      ...
      }
      @@ @@
      -struct intel_crtc_config
      +struct intel_crtc_state
      
      v2: Completely generate the patch with cocci. (Ander)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5cec258b
  2. 24 10月, 2014 1 次提交
  3. 01 10月, 2014 1 次提交
  4. 28 8月, 2014 1 次提交
    • M
      drm/i915: Remove bogus __init annotation from DMI callbacks · bbe1c274
      Mathias Krause 提交于
      The __init annotations for the DMI callback functions are wrong as this
      code can be called even after the module has been initialized, e.g. like
      this:
      
        # echo 1 > /sys/bus/pci/devices/0000:00:02.0/remove
        # modprobe i915
        # echo 1 > /sys/bus/pci/rescan
      
      The first command will remove the PCI device from the kernel's device
      list so the second command won't see it right away. But as it registers
      a PCI driver it'll see it on the third command. If the system happens to
      match one of the DMI table entries we'll try to call a function in long
      released memory and generate an Oops, at best.
      
      Fix this by removing the bogus annotation.
      
      Modpost should have caught that one but it ignores section reference
      mismatches from the .rodata section. :/
      
      Fixes: 25e341cf ("drm/i915: quirk away broken OpRegion VBT")
      Fixes: 8ca4013d ("CHROMIUM: i915: Add DMI override to skip CRT...")
      Fixes: 425d244c ("drm/i915: ignore LVDS on intel graphics systems...")
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Duncan Laurie <dlaurie@chromium.org>
      Cc: Jarod Wilson <jarod@redhat.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>	# Can modpost be fixed?
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      bbe1c274
  5. 18 8月, 2014 1 次提交
    • V
      drm/i915: Fix locking for intel_enable_pipe_a() · 208bf9fd
      Ville Syrjälä 提交于
      intel_enable_pipe_a() gets called with all the modeset locks already
      held (by drm_modeset_lock_all()), so trying to grab the same
      locks using another drm_modeset_acquire_ctx is going to fail miserably.
      
      Move most of the drm_modeset_acquire_ctx handling (init/drop/fini)
      out from intel_{get,release}_load_detect_pipe() into the callers
      (intel_{crt,tv}_detect()). Only the actual locking and backoff
      handling is left in intel_get_load_detect_pipe(). And in
      intel_enable_pipe_a() we just share the mode_config.acquire_ctx from
      drm_modeset_lock_all() which is already holding all the relevant locks.
      
      It's perfectly legal to lock the same ww_mutex multiple times using the
      same ww_acquire_ctx. drm_modeset_lock() will convert the returned
      -EALREADY into 0, so the caller doesn't need to do antyhing special.
      
      Fixes a hang on resume on my 830.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      208bf9fd
  6. 23 7月, 2014 1 次提交
  7. 11 7月, 2014 3 次提交
  8. 19 6月, 2014 1 次提交
  9. 05 6月, 2014 1 次提交
    • R
      drm: convert crtc and connection_mutex to ww_mutex (v5) · 51fd371b
      Rob Clark 提交于
      For atomic, it will be quite necessary to not need to care so much
      about locking order.  And 'state' gives us a convenient place to stash a
      ww_ctx for any sort of update that needs to grab multiple crtc locks.
      
      Because we will want to eventually make locking even more fine grained
      (giving locks to planes, connectors, etc), split out drm_modeset_lock
      and drm_modeset_acquire_ctx to track acquired locks.
      
      Atomic will use this to keep track of which locks have been acquired
      in a transaction.
      
      v1: original
      v2: remove a few things not needed until atomic, for now
      v3: update for v3 of connection_mutex patch..
      v4: squash in docbook
      v5: doc tweaks/fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      51fd371b
  10. 04 6月, 2014 1 次提交
  11. 05 5月, 2014 1 次提交
    • D
      drm/i915/crt: Remove ->mode_set callback · 894ed1ec
      Daniel Vetter 提交于
      We only set a few bits in the ADPA register, which we then read back
      in the enable/disable hooks. So we can just move that bit of state
      computation code to the place where we need it since setting these
      bits without enabling the CRT encoder has no effects.
      
      The only exceptions are the hotplug bits since they affect the hotplug
      detection logic, but we already set those in the ->reset function and
      then never touch them.
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      894ed1ec
  12. 04 4月, 2014 1 次提交
  13. 11 3月, 2014 2 次提交
  14. 08 3月, 2014 2 次提交
  15. 06 3月, 2014 2 次提交
  16. 14 2月, 2014 1 次提交
    • I
      drm/i915: add unregister callback to connector · 4932e2c3
      Imre Deak 提交于
      Since
      
      commit d9255d57
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Thu Sep 26 20:05:59 2013 -0300
      
      it became clear that we need to separate the unload sequence into two
      parts:
      
      1. remove all interfaces through which new operations on some object
         (crtc, encoder, connector) can be started and make sure all pending
         operations are completed
      2. do the actual tear down of the internal representation of the above
         objects
      
      The above commit achieved this separation for connectors by splitting
      out the sysfs removal part from the connector's destroy callback and
      doing this removal before calling drm_mode_config_cleanup() which does
      the actual tear-down of all the drm objects.
      
      Since we'll have to customize the interface removal part for different
      types of connectors in the upcoming patches, add a new unregister
      callback and move the interface removal part to it.
      
      No functional change.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4932e2c3
  17. 25 1月, 2014 1 次提交
    • D
      drm/i915: Shuffle modeset reset handling around · 754970ee
      Daniel Vetter 提交于
      Currently we're doing the reset handling a bit late, and we're doing
      it both in the driver load code and on resume. This makes it unusable
      for e.g. resetting the panel power sequence state like Paulo wants to.
      
      Instead of adding yet another single-use callback shuffle things
      around:
      - Output handling code is responsible to reset/init all state on its
        own at driver load time.
      - We call the reset functions much earlier, before we start using any
        of the modeset code.
      
      Compared to Paulo's new ->resume callback the only difference in
      placement is that ->reset is still called without dev->struct_mutex
      held. Which is imo a feature.
      
      v2: Rebase on top of the now merge dinq.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      754970ee
  18. 28 11月, 2013 1 次提交
  19. 09 11月, 2013 1 次提交
  20. 01 11月, 2013 1 次提交
    • L
      i915: fix compiler warning · 0baab4fd
      Linus Torvalds 提交于
      The last i915 drm update brought with it this annoying warning
      
        drivers/gpu/drm/i915/intel_crt.c: In function ‘intel_crt_get_config’:
        drivers/gpu/drm/i915/intel_crt.c:110:21: warning: unused variable ‘dev’ [-Wunused-variable]
          struct drm_device *dev = encoder->base.dev;
                             ^
      
      introduced by commit 7195a50b ("drm/i915: Add HSW CRT output readout
      support").
      
      Remove the offending pointless variable.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0baab4fd
  21. 29 10月, 2013 1 次提交
  22. 17 10月, 2013 1 次提交
  23. 01 10月, 2013 4 次提交
  24. 17 9月, 2013 1 次提交
    • V
      drm/i915: Fix port_clock and adjusted_mode.clock readout all over · 18442d08
      Ville Syrjälä 提交于
      Now that adjusted_mode.clock no longer contains the pixel_multiplier, we
      can kill the get_clock() callback and instead do the clock readout
      in get_pipe_config().
      
      Also i9xx_crtc_clock_get() can now extract the frequency of the PCH
      DPLL, so use it to populate port_clock accurately for PCH encoders.
      For DP in port A the encoder is still responsible for filling in
      port_clock. The FDI adjusted_mode.clock extraction is kept in place
      for some extra sanity checking, but we no longer need to pretend it's
      also the port_clock.
      
      In the encoder get_config() functions fill out adjusted_mode.clock
      based on port_clock and other details such as the DP M/N values,
      HDMI 12bpc and SDVO pixel_multiplier. For PCH encoders we will then
      do an extra sanity check to make sure the dotclock we derived from
      the FDI configuratiuon matches the one we derive from port_clock.
      
      DVO doesn't exist on PCH platforms, so it doesn't need to anything
      but assign adjusted_mode.clock=port_clock. And DDI is HSW only, so
      none of the changes apply there.
      
      v2: Use hdmi_reg color format to detect 12bpc HDMI case
      v3: Set adjusted_mode.clock for LVDS too
      v4: Rename ironlake_crtc_clock_get to ironlake_pch_clock_get,
          eliminate the useless link_freq variable.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      18442d08
  25. 11 9月, 2013 1 次提交
  26. 03 9月, 2013 1 次提交
  27. 05 8月, 2013 1 次提交
  28. 24 7月, 2013 1 次提交