1. 01 10月, 2013 15 次提交
    • V
      drm/i915: Move power well resume earlier · ebdcefc6
      Ville Syrjälä 提交于
      i915_restore_state() -> i915_restore_display() will attempt to
      re-disable VGA during resume. So the power well needs to be powered on
      before that.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ebdcefc6
    • V
      drm/i915: Move power well init earlier during driver load · a1485320
      Ville Syrjälä 提交于
      intel_modeset_init() will already attempt to disable VGA. In order to do
      that, it needs the power well to be on. So move the power well init
      to happen before intel_modeset_init() during driver load.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a1485320
    • V
      drm/i915: Redisable VGA before the modeset on resume · 7d0bc1ea
      Ville Syrjälä 提交于
      The VGA plane needs to be disabled before we start doing any
      modeset operations on resume.
      
      This should also guarantee that the power well will be enabled
      when we call i915_redisable_vga() since it gets explicitly powered on
      during resume, and will get powered back off during the modeset
      operation if no longer needed.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7d0bc1ea
    • V
      drm/i915: Fix unclaimed register access due to delayed VGA memory disable · ce352550
      Ville Syrjälä 提交于
      VGA registers live inside the power well on HSW, so in order to write
      the VGA MSR register we need the power well to be on.
      
      We really must write to the register to properly clear the
      VGA_MSR_MEM_EN enable bit, even if all VGA registers get zeroed when
      the power well is down. It seems that the implicit zeroing done by
      the power well is not enough to propagate the VGA_MSR_MEM_EN bit to
      whomever is actually responsible for the memory decode ranges.
      
      If we leave VGA memory decode enabled, and then turn off the power well,
      all VGA memory reads will return zeroes. But if we first disable VGA
      memory deocde and then turn off the power well, VGA memory reads
      return all ones, indicating that the access wasn't claimed by anyone.
      For the vga arbiter to function correctly the IGD must not claim the
      VGA memory accesses.
      
      Previously we were doing the VGA_MSR register access while the power well
      was excplicitly powered up during driver init. But ever since
      
       commit 6e1b4fda
       Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
       Date:   Thu Sep 5 20:40:52 2013 +0300
      
          drm/i915: Delay disabling of VGA memory until vgacon->fbcon handoff is done
      
      we delay the VGA memory disable until fbcon has initialized, and so
      there's a possibility that the power well got turned off during the
      fbcon modeset. Also vgacon_save_screen() will need the power well to be
      on to be able to read the VGA memory.
      
      So immediately after enabling the power well during init grab a refence
      for VGA purposes, and after all the VGA handling is done, release it.
      
      v2: Add intel_display_power_put() for the num_pipes==0 case
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Fix up the patch wiggle screw-up that I've done and which
      Paulo catched. Also polish spelling in the patch headline.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ce352550
    • D
      drm/i915: Rip out SUPPORTS_EDP · 6fca55b1
      Daniel Vetter 提交于
      It only controls the setting of the vbt.edp_support variable, which in
      turn only controls one debug output plus can also force-disable the
      lvds output.
      
      Since the value only restricted this logic to mobile ilk there's the
      slight risk that this will break lvds on desktop ilk or on snb/ivb
      platforms. But with the vbt it's better when we know what's going on
      here, so let's rip it out and see what happens.
      
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6fca55b1
    • P
      drm/i915: don't init DP or HDMI when not supported by DDI port · 311a2094
      Paulo Zanoni 提交于
      There's no reason to init a DP connector if the encoder just supports
      HDMI: we'll just waste hundreds and hundreds of cycles trying to do DP
      AUX transactions to detect if there's something there. Same goes for a
      DP connector that doesn't support HDMI, but I'm not sure these
      actually exist.
      
      v2: - Use bit fields
          - Remove useless identation level
          - Replace DRM_ERROR with DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      311a2094
    • P
      drm/i915: add some assertions about VBT DDI port types · 554d6af5
      Paulo Zanoni 提交于
      Our code makes a lot of assumptions regarding what each DDI port
      actually supports, and the VBT should tell us what is really happening
      in the hardware. So parse the information provided by the VBT and
      check if any of our assumptions is wrong.
      
      Our driver also has a history of not really trusting the VBT, so a
      WARN here could mean that:
       a) our coding assumptions are wrong
       b) the VBT is wrong
       c) we're incorrectly parsing the VBT
       d) the checks are wrong
      
      But I really hope we won't ever trigger any of those WARNs.
      
      v2: Don't check the redundant "Capabilities" field from byte 24 since
          it doesn't seem to be used.
      v3: Rebase
      v4: Replace WARN with DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      554d6af5
    • P
      drm/i915: check the DDC and AUX bits of the VBT on DDI machines · 6bf19e7c
      Paulo Zanoni 提交于
      Our code currently assumes that port X will use the DP AUX channel X
      and the DDC pin X. The VBT should tell us how things are mapped, so
      add some WARNs in case we discover our assumptions are wrong (or in
      case the VBT is just wrong, which is also perfectly possible).
      
      Why would someone wire port B to AUX C and DDC D?
      
      v2: Rebase
      v3: Convert WARNs to DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6bf19e7c
    • P
      drm/i915: use the HDMI DDI buffer translations from VBT · 6acab15a
      Paulo Zanoni 提交于
      We currently use the recommended values from BSpec, but the VBT
      specifies the correct value to use for the hardware we have, so use
      it. We also fall back to the recommended value in case we can't find
      the VBT.
      
      In addition, this code also provides some infrastructure to parse more
      information about the DDI ports. There's a lot more information we
      could extract and use in the future.
      
      v2: - Move some code to init_vbt_defaults.
      v3: - Rebase
          - Clarify the "DVO Port" matching code
      v4: - Use I915_MAX_PORTS
          - Change the HAS_DDI checks
          - Replace DRM_ERROR with DRM_DEBUG_KMS
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6acab15a
    • P
      drm/i915: VBT's child_device_config changes over time · 768f69c9
      Paulo Zanoni 提交于
      We currently treat the child_device_config as a simple struct, but
      this is not correct: new BDB versions change the meaning of some
      offsets, so the struct needs to be adjusted for each version.
      
      Since there are too many changes (today we're in version 170!), making
      a big versioned union would be too complicated, so child_device_config
      is now a union of 3 things: (i) a "raw" byte array that's safe to use
      anywhere; (ii)  an "old" structure that's the one we've been using and
      should be safe to keep in the SDVO and TV code; and (iii) a "common"
      structure that should contain only fields that are common for all the
      known VBT versions.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      768f69c9
    • C
      drm/i915: Do not unlock upon error in i915_gem_idle() · f7403347
      Chris Wilson 提交于
      We never took the lock ourselves and all callers expect the struct_mutex
      to be locked upon return (be it success or error), thereore dropping the
      lock along the error paths looks to be a vestigial error from
      
      commit db1b76ca
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Jul 9 16:51:37 2013 +0200
      
          drm/i915: don't frob mm.suspended when not using ums
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f7403347
    • D
      drm/i915: Use unsigned for overflow checks in execbuf · b205ca57
      Daniel Vetter 提交于
      There's actually no real risk since we already check for stricter
      constraints earlier (using UINT_MAX / sizeof (struct
      drm_i915_gem_exec_object2) as the limit). But in eb_create we use
      signed integers, which steals a factor of 2. Luckily struct
      drm_i915_gem_exec_object2 for this to not matter.
      
      Still, be consistent and use unsigned integers.
      
      Similar use unsinged integers when checking for overflows in the
      relocation entry processing.
      
      I've also added a new subtests to igt/gem_reloc_overflow to also
      test for overflowing args->buffer_count values.
      
      v2: Give the variables again tighter scope to make it clear that the
      computation is purely local and doesn't leak out to the 2nd block.
      Requested by Chris Wilson.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b205ca57
    • D
      drm/i915: Ditch INTELFB_CONN_LIMIT · 955382f3
      Daniel Vetter 提交于
      And the gratious overallocation of crtcs. Seems to go back to the ums
      days of yonder ...
      
      We also still need it to make the fbdev emulation happy, but I don't
      think there's really a need. Especially since the current fbdev
      emulation doesn't actually support cloning.
      
      v2: Use sizeof(*pointer) pattern (Jani).
      
      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>
      955382f3
    • D
      drm/i915: Use kcalloc more · a1e22653
      Daniel Vetter 提交于
      No buffer overflows here, but better safe than sorry.
      
      v2:
      - Fixup the sizeof conversion, I've missed the pointer deref (Jani).
      - Drop the redundant GFP_ZERO, kcalloc alreads memsets (Jani).
      - Use kmalloc_array for the execbuf fastpath to avoid the memset
        (Chris). I've opted to leave all other conversions as-is since they
        aren't in a fastpath and dealing with cleared memory instead of
        random garbage is just generally nicer.
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      [danvet: Drop the contentious kmalloc_array hunk in execbuf.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a1e22653
    • D
      drm/i915: use pointer = k[cmz...]alloc(sizeof(*pointer), ...) pattern · b14c5679
      Daniel Vetter 提交于
      Done while reviewing all our allocations for fubar. Also a few errant
      cases of lacking () for the sizeof operator - just a bit of OCD.
      
      I've left out all the conversions that also should use kcalloc from
      this patch  (it's only 2).
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b14c5679
  2. 26 9月, 2013 1 次提交
    • D
      drm/i915: Fix up usage of SHRINK_STOP · d3227046
      Daniel Vetter 提交于
      In
      
      commit 81e49f81
      Author: Glauber Costa <glommer@openvz.org>
      Date:   Wed Aug 28 10:18:13 2013 +1000
      
          i915: bail out earlier when shrinker cannot acquire mutex
      
      SHRINK_STOP was added to tell the core shrinker code to bail out and
      go to the next shrinker since the i915 shrinker couldn't acquire
      required locks. But the SHRINK_STOP return code was added to the
      ->count_objects callback and not the ->scan_objects callback as it
      should have been, resulting in tons of dmesg noise like
      
      shrink_slab: i915_gem_inactive_scan+0x0/0x9c negative objects to delete nr=-xxxxxxxxx
      
      Fix discusssed with Dave Chinner.
      
      References: http://www.spinics.net/lists/intel-gfx/msg33597.htmlReported-by: NKnut Petersen <Knut_Petersen@t-online.de>
      Cc: Knut Petersen <Knut_Petersen@t-online.de>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Glauber Costa <glommer@openvz.org>
      Cc: Glauber Costa <glommer@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Acked-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d3227046
  3. 25 9月, 2013 3 次提交
  4. 24 9月, 2013 1 次提交
    • C
      drm/i915: Use a temporary va_list for two-pass string handling · e29bb4eb
      Chris Wilson 提交于
      In
      
      commit edc3d884
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Thu May 23 13:55:35 2013 +0300
      
          drm/i915: avoid big kmallocs on reading error state
      
      we introduce a two-pass mechanism for splitting long strings being
      formatted into the error-state. The first pass finds the length, and the
      second pass emits the right portion of the string into the accumulation
      buffer. Unfortunately we use the same va_list for both passes, resulting
      in the second pass reading garbage off the end of the argument list. As
      the two passes are only used for boundaries between read() calls, the
      corruption is only rarely seen.
      
      This fixes the root cause behind
      
      commit baf27f9b
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Sat Jun 29 23:26:50 2013 +0100
      
          drm/i915: Break up the large vsnprintf() in print_error_buffers()
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e29bb4eb
  5. 21 9月, 2013 7 次提交
  6. 20 9月, 2013 10 次提交
  7. 19 9月, 2013 3 次提交