1. 27 Feb, 2015 5 commits
  2. 26 Feb, 2015 5 commits
  3. 25 Feb, 2015 12 commits
    • Matt Roper's avatar
      drm/i915: Ensure crtc_state backpointer is always initialized · 07878248
      Matt Roper authored
      As we transition to full atomic modesetting, we want to be able to pass
      intel_crtc_state around in various places that we pass intel_crtc
      directly today.  Ensure that the ->crtc backpointer is properly
      initialized in case we need to get back to the associated CRTC.
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      07878248
    • Matt Roper's avatar
      drm/i915: Use enabled value from crtc_state rather than crtc (v2) · 83d65738
      Matt Roper authored
      As vendors transition their drivers from legacy to atomic there's some
      duplication of data between drm_crtc and drm_crtc_state (since
      unconverted drivers likely won't have a state structure).
      
      i915 is partially converted and does have a crtc->state structure, but
      still uses direct crtc fields internally in many places, which causes
      the two sets of data to get out of sync.  As of commit
      
              commit 31c946e8
              Author: Daniel Vetter <daniel.vetter@ffwll.ch>
              Date:   Sun Feb 22 12:24:17 2015 +0100
      
                  drm: If available use atomic state in getcrtc ioctl
      
                  This way drivers fully converted to atomic don't need to update these
                  legacy state variables in their modeset code any more.
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      
      the DRM core starts assuming that the presence of a ->state structure
      implies that it should make use of the values stored there which, on
      i915, leads to the core code using stale values for CRTC 'enabled'
      status.
      
      Let's switch over to using the state value of 'enable' internally rather
      than using the drm_crtc field.  This ensures that our driver internals
      are working from the same data that the DRM core is, avoiding
      mismatches.
      
      This patch was generated with Coccinelle using the following semantic
      patch:
      
              <smpl>
              @@
              struct drm_crtc C;
              struct drm_crtc *CP;
              @@
              (
              - C.enabled
              + C.state->enable
              |
              - CP->enabled
              + CP->state->enable
              )
      
              // For assignments, we still update the legacy value as well as the state value
              // so add an extra assignment statement for that.
              @@
              struct drm_crtc C;
              struct drm_crtc *CP;
              expression E;
              @@
              (
                C.state->enable = E;
              + C.enabled = E;
              |
                CP->state->enable = E;
              + CP->enabled = E;
              )
              </smpl>
      
      The crtc->mode and crtc->hwmode fields should probably be transitioned
      over as well eventually, but we seem to do an okay job of keeping those
      up-to-date already so I want to minimize the changes that will clash
      with Ander's in-progress atomic work.
      
      v2: Don't remove the assignments to the legacy value when we assign to
          the state value.  A second cocci stanza takes care of adding the
          legacy assignment back where appropriate.  (Daniel)
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      83d65738
    • John Harrison's avatar
      drm/i915: Cache ringbuf pointer in request structure · 98e1bd4a
      John Harrison authored
      In execlist mode, the ringbuf is a function of the ring and context whereas in
      legacy mode, it is derived from the ring alone. Thus the calculation required to
      determine the ringbuf pointer from the ring (and context) also needs to test
      execlist mode or not. This is messy.
      
      Further, the request structure holds a pointer to both the ring and the context
      for which it was created. Thus, given a request, it is possible to derive the
      ringbuf in either legacy or execlist mode. Hence it is necessary to pass just
      the request in to all the low level functions rather than some combination of
      request, ring, context and ringbuf. However, rather than recalculating it each
      time, it is much simpler to just cache the ringbuf pointer in the request
      structure itself.
      
      Caching the pointer means the calculation is done once at request creation time
      and all further code and simply read it directly from the request structure.
      
      OTC-Jira: VIZ-5115
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      [danvet: Drop contentless comment in lrc alloc request entirely. And
      spelling fix in the commit message.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      98e1bd4a
    • John Harrison's avatar
      drm/i915: Add missing trace point to LRC execbuff code path · 5e4be7bd
      John Harrison authored
      There is a trace point in the legacy execbuffer execution path that is missing
      from the execlist path. Trace points are extremely useful for debugging and are
      used by various automated validation tests. Hence, this patch adds the missing
      trace point back in.
      
      OTC-Jira: VIZ-5115
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      5e4be7bd
    • John Harrison's avatar
      drm/i915: Rename 'flags' to 'dispatch_flags' for better code reading · 8e004efc
      John Harrison authored
      There is a flags word that is passed through the execbuffer code path all the
      way from initial decoding of the user parameters down to the very final dispatch
      buffer call. It is simply called 'flags'. Unfortuantely, there are many other
      flags words floating around in the same blocks of code. Even more once the GPU
      scheduler arrives.
      
      This patch makes it more obvious exactly which flags word is which by renaming
      'flags' to 'dispatch_flags'. Note that the bit definitions for this flags word
      already have an 'I915_DISPATCH_' prefix on them and so are not quite so
      ambiguous.
      
      OTC-Jira: VIZ-1587
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      [danvet: Resolve conflict with Chris' rework of the bb parsing.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      8e004efc
    • Michel Thierry's avatar
      drm/i915: Plumb drm_device through page tables operations · 06dc68d6
      Michel Thierry authored
      The next patch in the series will require it for alloc_pt_single.
      
      v2: Rebased after s/page_tables/page_table/.
      Signed-off-by: default avatarMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      06dc68d6
    • Ben Widawsky's avatar
      drm/i915: Create page table allocators · 06fda602
      Ben Widawsky authored
      As we move toward dynamic page table allocation, it becomes much easier
      to manage our data structures if break do things less coarsely by
      breaking up all of our actions into individual tasks.  This makes the
      code easier to write, read, and verify.
      
      Aside from the dissection of the allocation functions, the patch
      statically allocates the page table structures without a page directory.
      This remains the same for all platforms,
      
      The patch itself should not have much functional difference. The primary
      noticeable difference is the fact that page tables are no longer
      allocated, but rather statically declared as part of the page directory.
      This has non-zero overhead, but things gain additional complexity as a
      result.
      
      This patch exists for a few reasons:
      1. Splitting out the functions allows easily combining GEN6 and GEN8
      code. Page tables have no difference based on GEN8. As we'll see in a
      future patch when we add the DMA mappings to the allocations, it
      requires only one small change to make work, and error handling should
      just fall into place.
      
      2. Unless we always want to allocate all page tables under a given PDE,
      we'll have to eventually break this up into an array of pointers (or
      pointer to pointer).
      
      3. Having the discrete functions is easier to review, and understand.
      All allocations and frees now take place in just a couple of locations.
      Reviewing, and catching leaks should be easy.
      
      4. Less important: the GFP flags are confined to one location, which
      makes playing around with such things trivial.
      
      v2: Updated commit message to explain why this patch exists
      
      v3: For lrc, s/pdp.page_directory[i].daddr/pdp.page_directory[i]->daddr/
      
      v4: Renamed free_pt/pd_single functions to unmap_and_free_pt/pd (Daniel)
      
      v5: Added additional safety checks in gen8 clear/free/unmap.
      
      v6: Use WARN_ON and return -EINVAL in alloc_pt_range (Mika).
      
      v7: Make err_out loop symmetrical to the way we allocate in
      alloc_pt_range. Also s/page_tables/page_table and correct commit
      message (Mika)
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v3+)
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      06fda602
    • Ben Widawsky's avatar
      drm/i915: Complete page table structures · 7324cc04
      Ben Widawsky authored
      Move the remaining members over to the new page table structures.
      
      This can be squashed with the previous commit if desire. The reasoning
      is the same as that patch. I simply felt it is easier to review if split.
      
      v2: In lrc: s/ppgtt->pd_dma_addr[i]/ppgtt->pdp.page_directory[i].daddr/
      v3: Rebase.
      v4: Rebased after s/page_tables/page_table/.
      Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      7324cc04
    • Ben Widawsky's avatar
      drm/i915: page table abstractions · d7b3de91
      Ben Widawsky authored
      When we move to dynamic page allocation, keeping page_directory and pagetabs as
      separate structures will help to break actions into simpler tasks.
      
      To help transition the code nicely there is some wasted space in gen6/7.
      This will be ameliorated shortly.
      
      Following the x86 pagetable terminology:
      PDPE = struct i915_page_directory_pointer_entry.
      PDE = struct i915_page_directory_entry [page_directory].
      PTE = struct i915_page_table_entry [page_tables].
      
      v2: fixed mismatches after clean-up/rebase.
      
      v3: Clarify the names of the multiple levels of page tables (Daniel)
      
      v4: Addressing Mika's review comments.
      s/gen8_free_page_directories/gen8_free_page_directory and free the
      page tables for the directory there.
      In gen8_ppgtt_allocate_page_directories, do not leak previously allocated
      pt in case the page_directory alloc fails.
      Update error return handling in gen8_ppgtt_alloc.
      
      v5: Do not leak pt on error in gen6_ppgtt_allocate_page_tables. (Mika)
      
      v6: s/page_tables/page_table/. (Mika)
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d7b3de91
    • Sonika Jindal's avatar
      drm/i915/skl: Add support for edp1.4 low vswing · 7ad14a29
      Sonika Jindal authored
      Based upon vbt's vswing preemph settings value select the appropriate
      translations for edp.
      
      v2: Incorporating bspec changes for vswing and preemph levels, adding edp
      translation table. Removed HSW from selection 9 which is specific to skl and
      correcting the returning of level2 from max pre emph (Damien)
      
      v3: Rebasing on top of renaming patches. Adding level(3,0) since level(2,2) as
      mentioned in bspec is invalid as per edp spec. Also changed the determining of
      size of the table selected (Satheesh).
      
      v4: Adding level 3 in max voltage selection if low vswing is selected (Satheesh)
      
      v5: Add a comment stating that skl_ddi_translations_edp is for eDP 1.4
          low vswing panels.
      
      v6: Updating recommended DDI translation table for edp 1.4
      
      Reviewed-by: Satheeshakrishna M <satheeshakrishna.m@intel.com> (v4)
      Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> (v6)
      Signed-off-by: default avatarSonika Jindal <sonika.jindal@intel.com>
      Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      7ad14a29
    • Sonika Jindal's avatar
      drm/i915/skl: Support for edp low_vswing param in vbt · 9a57f5bb
      Sonika Jindal authored
      v2: Adding VBT version check for low_vswing field, and correcting parsing
      
      v3: (Damien)
       - Restrain the scope of the 'vswing' variable
       - Use the more idiomatic "ev_priv->vbt.edp_low_vswing = vswing == 0;"
        instead of if (foo) var = true; else var = false;
       - Shorten edp_vswing_premph_setting to edp_vswing_premph to fit in 80 chars
       - Add the version from which the edp_vswing_premph field is valid in the
        struct definition
      
      Reviewed-by: Satheeshakrishna M <satheeshakrishna.m@intel.com> (v2)
      Signed-off-by: default avatarSonika Jindal <sonika.jindal@intel.com>
      Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      9a57f5bb
    • Dan Carpenter's avatar
      drm/i915: cleanup some indenting · ba0635ff
      Dan Carpenter authored
      Static checkers complain that we should probably add curly braces
      because, from the indenting, it looks like seq_printf() should be inside
      the list_for_each_entry() loop.  But the code is actually correct, it's
      just the indenting which is off.
      
      Besides fixing the indenting on seq_printf(), I did add curly braces,
      because generally mult-line indents should have curly braces to make
      them more readable.
      
      The unintended indent was left behind and not unindented in
      
      commit d7f46fc4
      Author: Ben Widawsky <benjamin.widawsky@intel.com>
      Date:   Fri Dec 6 14:10:55 2013 -0800
      
          drm/i915: Make pin count per VMA
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      ba0635ff
  4. 24 Feb, 2015 8 commits
  5. 23 Feb, 2015 10 commits