1. 04 Mar, 2014 8 commits
  2. 02 Mar, 2014 1 commit
    • Daniel Vetter's avatar
      drm/i915: sprinkle static · b5ea642a
      Daniel Vetter authored
      Apparently we've missed a few more than what Fengguang's 0-day tester
      recently reported in i915_irq.c ... Makes sparse happy again (ignore
      some spurious stuff about ksyms of exported functions).
      
      Cc: kbuild test robot <fengguang.wu@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b5ea642a
  3. 14 Feb, 2014 17 commits
  4. 13 Feb, 2014 5 commits
    • Paulo Zanoni's avatar
      drm/i915: don't reference null pointer at i915_sink_crc · b6ae3c7c
      Paulo Zanoni authored
      Reproducible by runtime suspending a Haswell machine with eDP + HDMI
      outputs connected.
      
      [  209.600086] [drm:i915_runtime_suspend], Suspending device
      [  209.688435] BUG: unable to handle kernel NULL pointer dereference at 0000000000000060
      [  209.688500] IP: [<ffffffffa0109d4e>] i915_sink_crc+0x6e/0xf0 [i915]
      [  209.688577] PGD 36aba067 PUD 35d7f067 PMD 0
      [  209.688613] Oops: 0000 [#1] SMP
      [  209.688641] Modules linked in: fuse ip6table_filter ip6_tables ebtable_nat ebtables iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal coretemp microcode serio_raw e1000e pcspkr i2c_i801 ptp mei_me mei lpc_ich mfd_core pps_core dm_crypt i915 i2c_algo_bit crc32_pclmul drm_kms_helper crc32c_intel drm ghash_clmulni_intel video
      [  209.688893] CPU: 1 PID: 1797 Comm: pm_pc8 Not tainted 3.13.0+ #118
      [  209.688937] Hardware name: Intel Corporation Shark Bay Client platform/WhiteTip Mountain 1, BIOS HSWLPTU1.86C.0133.R00.1309172123 09/17/2013
      [  209.689023] task: ffff88007fb4b690 ti: ffff88007d9d2000 task.ti: ffff88007d9d2000
      [  209.689074] RIP: 0010:[<ffffffffa0109d4e>]  [<ffffffffa0109d4e>] i915_sink_crc+0x6e/0xf0 [i915]
      [  209.689169] RSP: 0018:ffff88007d9d3e68  EFLAGS: 00010246
      [  209.689205] RAX: 0000000000000000 RBX: ffff880036a03478 RCX: ffff8800366c9770
      [  209.689252] RDX: ffff88014325cf38 RSI: ffff88007fb4bd08 RDI: ffff88007fb4b690
      [  209.689299] RBP: ffff88007d9d3e98 R08: 0000000000000000 R09: 0000000000000000
      [  209.689346] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8800366c9148
      [  209.689393] R13: 00000000ffffffed R14: ffff88007d9d3f50 R15: ffff880036a03478
      [  209.689441] FS:  00007f5a74bc29c0(0000) GS:ffff88014f240000(0000) knlGS:0000000000000000
      [  209.689494] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  209.689533] CR2: 0000000000000060 CR3: 0000000079d7e000 CR4: 00000000001407e0
      [  209.689580] Stack:
      [  209.689594]  0000000000001000 ffff880146083980 ffff880146083980 0000000000000000
      [  209.689649]  ffff880146083980 0000000000000001 ffff88007d9d3f00 ffffffff811d0744
      [  209.689702]  0000000000000046 00007fff7949fe20 ffff880036a034b8 0000000000000080
      [  209.689756] Call Trace:
      [  209.689778]  [<ffffffff811d0744>] seq_read+0x164/0x3e0
      [  209.689816]  [<ffffffff811ab165>] vfs_read+0x95/0x160
      [  209.689851]  [<ffffffff811abc79>] SyS_read+0x49/0xa0
      [  209.689888]  [<ffffffff810ef64c>] ? __audit_syscall_entry+0x9c/0xf0
      [  209.689933]  [<ffffffff81659412>] system_call_fastpath+0x16/0x1b
      
      Testcase: igt/pm_pc8 (do a full run, it will fail at the debugfs-read subtest)
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Flip around NULL check for robustness.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b6ae3c7c
    • Damien Lespiau's avatar
      drm/i915/lvds: Remove dead code from failing case · 7fb4a3a3
      Damien Lespiau authored
      Coverity points out that, if we end up in the 'failed' label, that's
      precisely because we couldn't retrieve a fixed mode (ie fixed_mode is
      NULL) and then "if (fixed_mode)" is always false.
      
      Remove that dead code.
      Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      7fb4a3a3
    • Jesse Barnes's avatar
      drm/i915: don't preserve inherited configs with nothing on v2 · 02f5eebb
      Jesse Barnes authored
      It can be corrected later and may be what was actually desired, but
      generally isn't, so if we find nothing is enabled, let the core DRM fb
      helper figure something out.
      
      v2: free the array too (Jesse)
      
      Note that this also undoes any changes in case we bail out due to hw
      cloning.
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      02f5eebb
    • Ben Widawsky's avatar
      drm/i915/bdw: Split up PPGTT cleanup · b45a6715
      Ben Widawsky authored
      This will make the code more readable, and extensible which is needed
      for upcoming feature work. Eventually, we'll do the same for init.
      Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b45a6715
    • Ville Syrjälä's avatar
      drm/i915: Convert DIP port switch cases to a simple macro · 822cdc52
      Ville Syrjälä authored
      We have a couple of switch cases to compute the port value for the
      VIDEO_DIP_CTL register. Replace them with a simple macro.
      
      We do lose a few BUG() calls, but many people may consider that
      an improvement.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      822cdc52
  5. 12 Feb, 2014 9 commits
    • Daniel Vetter's avatar
      drm/i915: delay master/sarea deref for legacy ioctls · 4d10cc0f
      Daniel Vetter authored
      ... past the check for DRIVER_MODESET. Avoids races with userspace
      opening a master and our sarea setup.
      
      Cc: Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      4d10cc0f
    • Daniel Vetter's avatar
      drm/i915: protect ringbuffer sarea update behind !MODESET · fb19e2ac
      Daniel Vetter authored
      Avoids surprises when userspace races open/closes against this.
      
      Cc: Stéphane Marchesin <marcheu@chromium.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      fb19e2ac
    • Daniel Vetter's avatar
      drm/i915: kill intel_crtc_update_sarea_pos · 1fcb195e
      Daniel Vetter authored
      We assign the sarea_priv pointer only in the dma ioctl, which is
      disallowed when kernel modesetting is enabled. So this is dead code.
      
      Cc: Stéphane Marchesin <marcheu@chromium.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      1fcb195e
    • Jesse Barnes's avatar
      drm/i915: allow re-use BIOS connector config for initial fbdev config v3 · eb1bfe80
      Jesse Barnes authored
      The BIOS or boot loader will generally create an initial display
      configuration for us that includes some set of active pipes and
      displays.  This routine tries to figure out which pipes and connectors
      are active and stuffs them into the crtcs and modes array given to us by
      the drm_fb_helper code.
      
      The overall sequence is:
        intel_fbdev_init - from driver load
          intel_fbdev_init_bios - initialize the intel_fbdev using BIOS data
          drm_fb_helper_init - build fb helper structs
          drm_fb_helper_single_add_all_connectors - more fb helper structs
        intel_fbdev_initial_config - apply the config
          drm_fb_helper_initial_config - call ->probe then register_framebuffer()
              drm_setup_crtcs - build crtc config for fbdev
                intel_fb_initial_config - find active connectors etc
              drm_fb_helper_single_fb_probe - set up fbdev
                intelfb_create - re-use or alloc fb, build out fbdev structs
      
      v2: use BIOS connector config unconditionally if possible (Daniel)
          check for crtc cloning and reject (Daniel)
          fix up comments (Daniel)
      v3: use command line args and preferred modes first (Ville)
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Tested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Re-add the WARN_ON for a missing encoder crtc - the state
      sanitizer should take care of this. And spell-ocd the comments.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      eb1bfe80
    • Jesse Barnes's avatar
      drm: export cmdline and preferred mode functions from fb helper · 2f1046f3
      Jesse Barnes authored
      This allows drivers to use them in custom initial_config functions.
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Acked-by: default avatarDave Airlie <airlied@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      2f1046f3
    • Daniel Vetter's avatar
      drm/i915: Some polish for the new pipestat_irq_handler · bbb5eebf
      Daniel Vetter authored
      Just a bit of polish which I hope will help me with massaging some
      internal patches to use Imre's reworked pipestat handling:
      - Don't check for underrun reporting or enable pipestat interrupts
        twice.
      - Frob the comments a bit.
      - Do the iir PIPE_EVENT to pipe mapping explicitly with a switch. We
        only have one place which does this, so better to make it explicit.
      
      v2: Ville noticed that I've broken the logic a bit with trying to
      avoid checking whether we're interested in a given pipe twice. push
      the PIPESTAT read down after we've computed the mask of interesting
      bits first to avoid that duplication properly.
      
      v3: Squash in fixups from Imre on irc.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      bbb5eebf
    • Daniel Vetter's avatar
      drm/i915: Pass explicit mode into mode_from_pipe_config v3 · f6a83288
      Daniel Vetter authored
      We want to reuse this in the fbdev initial config code independently
      from any fastboot hacks. So allow a bit more flexibility.
      
      v2: Forgot to git add ...
      v3: make non-static (Jesse)
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f6a83288
    • Jesse Barnes's avatar
      drm/i915: read out hw state earlier v2 · fa9fa083
      Jesse Barnes authored
      We want to do this early on before we try to fetch the plane config,
      which depends on some of the pipe config state.
      
      Note that the important part is that we do this before we initialize
      gem, since otherwise we can't properly pre-reserve the stolen memory
      for framebuffers inherited from the bios.
      
      v2: split back out from get_plane_config change (Daniel)
          update for recent locking & reset changes (Jesse)
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Explain a bit more why we need to move this.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      fa9fa083
    • Imre Deak's avatar
      drm/i915: unbind fbs from crtcs during driver unload · 9d661251
      Imre Deak authored
      So far during driver unload we called drm_framebuffer_cleanup() for the
      fbdev fb, which only removes the fb from the drm fb list regardless of
      its reference count, but leaves the fb bound on an active crtc. Since
      the fb's backing storage was freed this could mean we scan some random
      memory content out afterwards. It's not a big issue since the fb is
      allocated from stolen memory and afaik there is no other user for that
      than i915. It's still cleaner to properly unbind the fb and disable the
      crtc, which is what drm_framebuffer_remove() does.
      
      Note that after
      
      commit 88891eb1e9eca0ba619518bed31580f91e9cf84d
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Mon Feb 10 18:00:38 2014 +0100
      
      we call drm_framebuffer_cleanup() only after dropping the last reference
      on the fb, but that won't happen since we don't unbind the fb. This
      results in a drm core warn about a leaked fb.
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      9d661251