1. 17 6月, 2014 1 次提交
  2. 14 6月, 2014 1 次提交
    • R
      drm/i915: Force PSR exit by inactivating it. · 7c8f8a70
      Rodrigo Vivi 提交于
      The perfect solution for psr_exit is the hardware tracking the changes and
      doing the psr exit by itself. This scenario works for HSW and BDW with some
      environments like Gnome and Wayland.
      
      However there are many other scenarios that this isn't true. Mainly one right
      now is KDE users on HSW and BDW with PSR on. User would miss many screen
      updates. For instances any key typed could be seen only when mouse cursor is
      moved. So this patch introduces the ability of trigger PSR exit on kernel side
      on some common cases that.
      
      Most of the cases are coverred by psr_exit at set_domain. The remaining cases
      are coverred by triggering it at set_domain, busy_ioctl, sw_finish and
      mark_busy.
      
      The downside here might be reducing the residency time on the cases this
      already work very wall like Gnome environment. But so far let's get focused
      on fixinge issues sio PSR couild be used for everybody and we could even
      get it enabled by default. Later we can add some alternatives to choose the
      level of PSR efficiency over boot flag of even over crtc property.
      
      v2: remove exit from connector_dpms. Daniel pointed this is the wrong way and
      also this isn't needed for BDW and HSW anyway.
      
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NVijay Purushothaman <vijay.a.purushothaman@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7c8f8a70
  3. 13 6月, 2014 6 次提交
  4. 11 6月, 2014 3 次提交
  5. 05 6月, 2014 2 次提交
  6. 04 6月, 2014 3 次提交
    • D
      drm: Split connection_mutex out of mode_config.mutex (v3) · 6e9f798d
      Daniel Vetter 提交于
      After the split-out of crtc locks from the big mode_config.mutex
      there's still two major areas it protects:
      - Various connector probe states, like connector->status, EDID
        properties, probed mode lists and similar information.
      - The links from connector->encoder and encoder->crtc and other
        modeset-relevant connector state (e.g. properties which control the
        panel fitter).
      
      The later is used by modeset operations. But they don't really care
      about the former since it's allowed to e.g. enable a disconnected VGA
      output or with a mode not in the probed list.
      
      Thus far this hasn't been a problem, but for the atomic modeset
      conversion Rob Clark needs to convert all modeset relevant locks into
      w/w locks. This is required because the order of acquisition is
      determined by how userspace supplies the atomic modeset data. This has
      run into troubles in the detect path since the i915 load detect code
      needs _both_ protections offered by the mode_config.mutex: It updates
      probe state and it needs to change the modeset configuration to enable
      the temporary load detect pipe.
      
      The big deal here is that for the probe/detect users of this lock a
      plain mutex fits best, but for atomic modesets we really want a w/w
      mutex. To fix this lets split out a new connection_mutex lock for the
      modeset relevant parts.
      
      For simplicity I've decided to only add one additional lock for all
      connector/encoder links and modeset configuration states. We have
      piles of different modeset objects in addition to those (like bridges
      or panels), so adding per-object locks would be much more effort.
      
      Also, we're guaranteed (at least for now) to do a full modeset if we
      need to acquire this lock. Which means that fine-grained locking is
      fairly irrelevant compared to the amount of time the full modeset will
      take.
      
      I've done a full audit, and there's just a few things that justify
      special focus:
      - Locking in drm_sysfs.c is almost completely absent. We should
        sprinkle mode_config.connection_mutex over this file a bit, but
        since it already lacks mode_config.mutex this patch wont make the
        situation any worse. This is material for a follow-up patch.
      
      - omap has a omap_framebuffer_flush function which walks the
        connector->encoder->crtc links and is called from many contexts.
        Some look like they don't acquire mode_config.mutex, so this is
        already racy. Again fixing this is material for a separate patch.
      
      - The radeon hot_plug function to retrain DP links looks at
        connector->dpms. Currently this happens without any locking, so is
        already racy. I think radeon_hotplug_work_func should gain
        mutex_lock/unlock calls for the mode_config.connection_mutex.
      
      - Same applies to i915's intel_dp_hot_plug. But again, this is already
        racy.
      
      - i915 load_detect code needs to acquire this lock. Which means the
        w/w dance due to Rob's work will be nicely contained to _just_ this
        function.
      
      I've added fixme comments everywhere where it looks suspicious but in
      the sysfs code. After a quick irc discussion with Dave Airlie it
      sounds like the lack of locking in there is due to sysfs cleanup fun
      at module unload.
      
      v1: original (only compile tested)
      
      v2: missing mutex_init(), etc (from Rob Clark)
      
      v3: i915 needs more care in the conversion:
      - Protect the edp pp logic with the connection_mutex.
      - Use connection_mutex in the backlight code due to
        get_pipe_from_connector.
      - Use drm_modeset_lock_all in suspend/resume paths.
      - Update lock checks in the overlay code.
      
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      6e9f798d
    • J
      drm/i915: replace drm_get_encoder_name() with direct name field use · 8e329a03
      Jani Nikula 提交于
      Generated using semantic patches:
      
      @@
      expression E;
      @@
      
      - drm_get_encoder_name(&E)
      + E.name
      
      @@
      expression E;
      @@
      
      - drm_get_encoder_name(E)
      + E->name
      
      v2: Turn drm_get_encoder_name(&E) into E.name instead of &(E)->name.
      Acked-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8e329a03
    • J
      drm/i915: replace drm_get_connector_name() with direct name field use · c23cc417
      Jani Nikula 提交于
      Generated using semantic patches:
      
      @@
      expression E;
      @@
      
      - drm_get_connector_name(&E)
      + E.name
      
      @@
      expression E;
      @@
      
      - drm_get_connector_name(E)
      + E->name
      
      v2: Turn drm_get_connector_name(&E) into E.name instead of &(E)->name.
      Acked-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c23cc417
  7. 21 5月, 2014 1 次提交
    • D
      drm/i915: Drop now misleading DDI comment from dp_link_down · bc76e320
      Daniel Vetter 提交于
      Since
      
      commit 2e82a720
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Fri Jan 17 15:46:43 2014 +0200
      
          drm/i915: don't disable DP port after a failed link training
      
      and
      
      commit 5d6a1116
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Thu Jan 16 18:35:57 2014 +0200
      
          drm/i915: don't disable the DP port if the link is lost
      
      we no longer call intel_dp_link_down from generic DP code, but only
      from the !HAS_DDI dp encoder functions. hsw/bdw have their own encoder
      disabling callback in intel_ddi.c.
      
      Hence the early return is no longer needed and the big comment just
      confusing, so let's rip it out. To ensure what we don't accidentally
      use this again on ddi encoders add a WARN_ON instead.
      
      Spotted while reading through intel_dp.c
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bc76e320
  8. 20 5月, 2014 8 次提交
  9. 16 5月, 2014 3 次提交
    • D
      drm/i915/dp: Remove ->mode_set callback · 8ac33ed3
      Daniel Vetter 提交于
      With all the preceding refactoring the dp mode_set callback only
      computes a bit of state (all derived from the pipe config) and also
      writes the eld. As long as we do that before we enable the audio bit
      or depend upon the correct value in intel_dp->DP we'll be fine.
      
      No other hw state is touched.
      
      We therefore only need to check that clearing intel_dp->DP is save.
      Which it is since when we re-enable we already mask out all the bits
      the link training code sets. And we need to keep on doing that so that
      the re-train loop walking over pre-emph/voltage-swing values still
      works properly.
      Reviewed-by: NNaresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8ac33ed3
    • D
      drm/i915/dp: Move port A pll setup to g4x_pre_enable_dp · d41f1efb
      Daniel Vetter 提交于
      Only ilk/snb/ivb need the port A pll setup, so move it to the
      pre_enable hook for those platforms. We can savely do this since on
      those platforms there's nothing that touches the hardware between the
      encoder->mode_set and the encoder->pre_enable calls.
      
      Also add a comment that port A is ilk+ only.
      Reviewed-by: NNaresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d41f1efb
    • D
      drm/i915: Track has_audio in the pipe config · 9ed109a7
      Daniel Vetter 提交于
      Including state readout and cross-checking. This allows us to get rid
      of crtc->eld_vld on hsw+. It also means that fastboot will be unhappy
      if the BIOS hasn't set up the audio routing like we want it too.
      
      Wrt fastboot and external screens I see a few options:
      - Don't.
      - Try to fix up eld, infoframes and audio settings after the fact. But
        that means some pretty extensive reworking of our code which
        currently does all this while the pipe/port is still off.
      
      I won't bother with converting SDVO over to this because the audio
      support for SDVO is very lacking:
      - We don't update the eld.
      - We don't update the audio state on the sdvo encoder.
      - We don't check whether the platform can even feed audio to the sdvo
        encoder.
      
      I've converted hdmi, dp & ddi all in one go since ddi needs both hdmi
      and dp converted and so doing it step-by-step would have required a
      few intermediate hacks.
      Reviewed-by: NNaresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9ed109a7
  10. 15 5月, 2014 1 次提交
  11. 13 5月, 2014 3 次提交
    • C
      drm/i915/chv: Pipe select change for DP and HDMI · 44f37d1f
      Chon Ming Lee 提交于
      With additional of pipe C, current 1 bit registers for pipe select
      for HDMI and DP are no longer able to gather for 3 pipes. As a result,
      new bits location in the same registers are added.
      
      For HDMI, VLV uses bit 30, CHV uses bit 24-25.
      
      For DP, VLV uses bit 30, CHV uses bit 16-17.
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NChon Ming Lee <chon.ming.lee@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      44f37d1f
    • C
      drm/i915/chv: Add phy supports for Cherryview · e4a1d846
      Chon Ming Lee 提交于
      Added programming phy layer for CHV based on "Application note for 1273
      CHV Display phy".
      
      v2: Rebase the code and do some cleanup.
      v3: Rework based on Ville review.
          -Fix the macro where the ch info need to swap, and add parens to ?
      	 operator.
      	-Fix wrong bit define for DPIO_PCS_SWING_CALC_0 and
      	 DPIO_PCS_SWING_CALC_1 and rename for meaningful.
          -Add some comments for CHV specific DPIO registers.
          -Change the dp margin registery value to decimal to align with the
      	 doc.
      	-Fix the not clearing some value in vlv_dpio_read before write again.
          -Create new hdmi/dp encoder function for chv instead of share with
      	valleyview.
      v4: Rebase the code after rename the DPIO registers define and upstream
      	change.
          Based on Ville review.
          -For unique transition scale selection, after Ville point out, look
      	 like the doc might wrong for the bit 26.  Use bit 27 for ch0 and
      	 ch1.
      	-Break up some dpio write value into two/three steps for readability.
      	-Remove unrelated change.
          -Add some shift define for some registers instead just give the hex
      	value.
          -Fix a bug where write to wrong VLV_TX_DW3.
      v5: Based on Ville review.
      	- Move tx lane latency optimal setting from chv_dp_pre_pll_enable to
      	  chv_pre_enable_dp, and chv_hdmi_pre_pll_enable to
      	  chv_hdmi_pre_enable respectively.
       	- Fix typo in one margin_reg_value for DP_TRAIN_VOLTAGE_SWING_400.
      	- Clear DPIO_TX_UNIQ_TRANS_SCALE_EN for DP and HDMI.
      	- Mask the old deemph and swing bits for hdmi.
      v6: Remove stub for pre_pll_enable for dp and hdmi.
      Signed-off-by: NChon Ming Lee <chon.ming.lee@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      [vsyrjala: Don't touch panel power sequencing on DP]
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e4a1d846
    • C
      drm/i915/chv: find the best divisor for the target clock v4 · ef9348c8
      Chon Ming Lee 提交于
      Based on the chv clock limit, find the best divisor.
      
      The divisor data has been verified with this spreadsheet.
      P1273_DPLL_Programming Spreadsheet.
      
      v2: Rebase the code and change the chv_find_best_dpll based on new
      standard way to use intel_PLL_is_valid.  Besides, clean up some extra
      variables.
      
      v3: Ville suggest better fixed point for m2 calculation.
      
      v4: -Add comment for the limit is compute using fast clock. (Ville)
      	-Don't pass the request clock to chv_clock, as the same function will
      	 be use clock readout, which doens't have request clock. (Ville)
      	-Add and use DIV_ROUND_CLOSEST_ULL to consistent with other clock
      	calculation. (Ville)
      	-Fix the dp m2 after m2 has stored fixed point. (Ville)
      Signed-off-by: NChon Ming Lee <chon.ming.lee@intel.com>
      [vsyrjala: Avoid div-by-zero in chv_clock()]
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ef9348c8
  12. 07 5月, 2014 2 次提交
  13. 05 5月, 2014 2 次提交
  14. 30 4月, 2014 1 次提交
  15. 23 4月, 2014 1 次提交
    • P
      drm/i915: get power domain in case the BIOS enabled eDP VDD · 63635217
      Paulo Zanoni 提交于
      If I unplug the eDP monitor, the BIOS of my machine will enable the
      VDD bit, then when the driver loads it will think VDD is enabled. It
      will detect that the eDP is not enabled and return false from
      intel_edp_init_connector. This will trigger a call to
      edp_panel_vdd_off_sync(), which trigger a WARN saying that the
      refcount of the power domain is less than zero.
      
      The problem happens because the driver gets a refcount whenever it
      enables the VDD bit, and puts the refcount whenever it disables the
      VDD bit. But on this case, the BIOS enabled VDD, so all we do is to
      call put() without calling get() first, so the code added is there to
      make sure we always have the get() in case the BIOS enabled the bit.
      
      This regression was introduced in
      commit e9cb81a2
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Thu Nov 21 13:47:23 2013 -0200
      
          drm/i915: get a runtime PM reference when the panel VDD is on
      
      v2: - Rebase
      
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org (v3.13+)
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      63635217
  16. 10 4月, 2014 2 次提交
    • P
      drm/i915: Add support for DRRS to switch RR · 439d7ac0
      Pradeep Bhat 提交于
      This patch computes and stored 2nd M/N/TU for switching to different
      refresh rate dynamically. PIPECONF_EDP_RR_MODE_SWITCH bit helps toggle
      between alternate refresh rates programmed in 2nd M/N/TU registers.
      
      v2: Daniel's review comments
      Computing M2/N2 in compute_config and storing it in crtc_config
      
      v3: Modified reference to edp_downclock and edp_downclock_avail based on the
      changes made to move them from dev_private to intel_panel.
      
      v4: Modified references to is_drrs_supported based on the changes made to
      rename it to drrs_support.
      
      v5: Jani's review comments
      Removed superfluous return statements. Changed support for Gen 7 and above.
      Corrected indentation. Re-structured the code which finds crtc and connector
      from encoder. Changed some logs to be less verbose.
      
      v6: Modifying i915_drrs to include only intel connector as intel_dp can be
      derived from intel connector when required.
      
      v7: As per internal review comments, acquiring mutex just before accessing
      drrs RR. As per Chris's review comments, added documentation about the use
      of locking in the function.
      
      v8: Incorporated Jani's review comments.
      Removed reference to edp_downclock.
      
      v9: Jani's review comments. Modified comment in set_drrs. Changed index to
      type edp_drrs_refresh_rate_type. Check if PSR is enabled before setting
      registers fo DRRS.
      Signed-off-by: NPradeep Bhat <pradeep.bhat@intel.com>
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      439d7ac0
    • P
      drm/i915: Parse EDID probed modes for DRRS support · 4f9db5b5
      Pradeep Bhat 提交于
      This patch and finds out the lowest refresh rate supported for the resolution
      same as the fixed_mode.
      It also checks the VBT fields to see if panel supports seamless DRRS or not.
      Based on above data it marks whether eDP panel supports seamless DRRS or not.
      This information is needed for supporting seamless DRRS switch for certain
      power saving usecases. This patch is tested by enabling the DRM logs and
      user should see whether Seamless DRRS is supported or not.
      
      v2: Daniel's review comments
      Modified downclock deduction based on intel_find_panel_downclock
      
      v3: Chris's review comments
      Moved edp_downclock_avail and edp_downclock to intel_panel
      
      v4: Jani's review comments.
      Changed name of the enum edp_panel_type to drrs_support type.
      Change is_drrs_supported to drrs_support of type enum drrs_support_type.
      
      v5: Incorporated Jani's review comments
      Modify intel_dp_drrs_initialize to return downclock mode. Support for Gen7
      and above.
      
      v6: Incorporated Chris's review comments.
      Changed initialize to init in intel_drrs_initialize
      
      v7: Incorporated Jani's review comments.
      Removed edp_downclock and edp_downclock_avail. Return NULL explicitly.
      Make drrs_state and unnamed struct. Move Gen based check inside drrs_init.
      
      v8: Made changes to track PSR enable/disable throughout system use (instead
      of just in the init sequence) for disabling/enabling DRRS. Jani's review
      comments.
      
      v9: PSR tracking will be done as part of idleness detection patch. Removed
      PSR state tracker in i915_drrs. Jani's review comments.
      
      v10: Added log for DRRS not supported in drrs_init
      
      v11: Modification in drrs_init. suggested by Jani
      Signed-off-by: NPradeep Bhat <pradeep.bhat@intel.com>
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4f9db5b5