1. 11 8月, 2017 1 次提交
    • V
      drm/i915: Add render decompression support · 2e2adb05
      Ville Syrjälä 提交于
      SKL+ display engine can scan out certain kinds of compressed surfaces
      produced by the render engine. This involved telling the display engine
      the location of the color control surfae (CCS) which describes
      which parts of the main surface are compressed and which are not. The
      location of CCS is provided by userspace as just another plane with its
      own offset.
      
      Add the required stuff to validate the user provided AUX plane metadata
      and convert the user provided linear offset into something the hardware
      can consume.
      
      Due to hardware limitations we require that the main surface and
      the AUX surface (CCS) be part of the same bo. The hardware also
      makes life hard by not allowing you to provide separate x/y offsets
      for the main and AUX surfaces (excpet with NV12), so finding suitable
      offsets for both requires a bit of work. Assuming we still want keep
      playing tricks with the offsets. I've just gone with a dumb "search
      backward for suitable offsets" approach, which is far from optimal,
      but it works.
      
      Also not all planes will be capable of scanning out compressed surfaces,
      and eg. 90/270 degree rotation is not supported in combination with
      decompression either.
      
      This patch may contain work from at least the following people:
      * Vandana Kannan <vandana.kannan@intel.com>
      * Daniel Vetter <daniel@ffwll.ch>
      * Ben Widawsky <ben@bwidawsk.net>
      
      v2: Deal with display workarounds 0390, 0531, 1125 (Paulo)
      v3: Pretend CCS tiles are regular 128 byte wide Y tiles (Jason)
          Put the AUX register defines to the correct place
          Fix up the slightly bogus rotation check
      v4: Use I915_WRITE_FW() due to plane update locking changes
          s/return -EINVAL/goto err/ in intel_framebuffer_init()
          Eliminate a bunch hardcoded numbers in CCS code
      
      v5: (By Ben)
      conflict resolution +
      -               res_blocks += fixed_16_16_to_u32_round_up(y_tile_minimum);
      +               res_blocks += fixed16_to_u32_round_up(y_tile_minimum);
      
      v6: (daniels) Fix botched commit message.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NVille Syrjä <ville.syrjala@linux.intel.com>
      Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      Reviewed-by: NDaniel Stone <daniels@collabora.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170801165817.7063-1-ben@bwidawsk.net
      2e2adb05
  2. 10 8月, 2017 1 次提交
  3. 04 8月, 2017 2 次提交
  4. 27 7月, 2017 8 次提交
  5. 08 7月, 2017 2 次提交
  6. 03 7月, 2017 1 次提交
  7. 30 6月, 2017 1 次提交
  8. 26 6月, 2017 1 次提交
  9. 20 6月, 2017 1 次提交
  10. 15 6月, 2017 1 次提交
    • R
      drm/i915/perf: Add OA unit support for Gen 8+ · 19f81df2
      Robert Bragg 提交于
      Enables access to OA unit metrics for BDW, CHV, SKL and BXT which all
      share (more-or-less) the same OA unit design.
      
      Of particular note in comparison to Haswell: some OA unit HW config
      state has become per-context state and as a consequence it is somewhat
      more complicated to manage synchronous state changes from the cpu while
      there's no guarantee of what context (if any) is currently actively
      running on the gpu.
      
      The periodic sampling frequency which can be particularly useful for
      system-wide analysis (as opposed to command stream synchronised
      MI_REPORT_PERF_COUNT commands) is perhaps the most surprising state to
      have become per-context save and restored (while the OABUFFER
      destination is still a shared, system-wide resource).
      
      This support for gen8+ takes care to consider a number of timing
      challenges involved in synchronously updating per-context state
      primarily by programming all config state from the cpu and updating all
      current and saved contexts synchronously while the OA unit is still
      disabled.
      
      The driver intentionally avoids depending on command streamer
      programming to update OA state considering the lack of synchronization
      between the automatic loading of OACTXCONTROL state (that includes the
      periodic sampling state and enable state) on context restore and the
      parsing of any general purpose BB the driver can control. I.e. this
      implementation is careful to avoid the possibility of a context restore
      temporarily enabling any out-of-date periodic sampling state. In
      addition to the risk of transiently-out-of-date state being loaded
      automatically; there are also internal HW latencies involved in the
      loading of MUX configurations which would be difficult to account for
      from the command streamer (and we only want to enable the unit when once
      the MUX configuration is complete).
      
      Since the Gen8+ OA unit design no longer supports clock gating the unit
      off for a single given context (which effectively stopped any progress
      of counters while any other context was running) and instead supports
      tagging OA reports with a context ID for filtering on the CPU, it means
      we can no longer hide the system-wide progress of counters from a
      non-privileged application only interested in metrics for its own
      context. Although we could theoretically try and subtract the progress
      of other contexts before forwarding reports via read() we aren't in a
      position to filter reports captured via MI_REPORT_PERF_COUNT commands.
      As a result, for Gen8+, we always require the
      dev.i915.perf_stream_paranoid to be unset for any access to OA metrics
      if not root.
      
      v5: Drain submitted requests when enabling metric set to ensure no
          lite-restore erases the context image we just updated (Lionel)
      
      v6: In addition to drain, switch to kernel context & update all
          context in place (Chris)
      
      v7: Add missing mutex_unlock() if switching to kernel context fails
          (Matthew)
      
      v8: Simplify OA period/flex-eu-counters programming by using the
          batchbuffer instead of modifying ctx-image (Lionel)
      
      v9: Back to updating the context image (due to erroneous testing,
          batchbuffer programming the OA unit doesn't actually work)
          (Lionel)
          Pin context before updating context image (Chris)
          Drop MMIO programming now that we switch to a kernel context with
          right values in initial context image (Chris)
      
      v10: Just pin_map the contexts we want to modify or let the
           configuration happen on first use (Chris)
      
      v11: Update kernel context OA config through the batchbuffer rather
           than on the fly ctx-image update (Lionel)
      
      v12: Rework OA context registers update again by swithing away from
           user contexts and reconfiguring the kernel context through the
           batchbuffer and updating all the other contexts' context image.
           Also take care to lock slice/subslice configuration when OA is
           on. (Lionel)
      
      v13: Request rpcs updates on all engine when updating the OA config
           (Lionel)
      
      v14: Drop any kind of rpcs management now that we monitor sseu
           configuration changes in a later patch (Lionel)
           Remove usleep after programming the NOA configs on Gen8+, this
           doesn't seem to be needed (Lionel)
      
      v15: Respect coding style for block comments (Chris)
      
      v16: Add missing i915_add_request() in case we fail to emit OA
           configuration (Matthew)
      Signed-off-by: NRobert Bragg <robert@sixbynine.org>
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: Matthew Auld <matthew.auld@intel.com> \o/
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      19f81df2
  11. 13 6月, 2017 7 次提交
  12. 07 6月, 2017 3 次提交
  13. 03 6月, 2017 2 次提交
    • R
      drm/i915/cnp: add CNP gmbus support · 3d02352c
      Rodrigo Vivi 提交于
      On CNP PCH based platforms the gmbus is on the south display that
      is on PCH. The existing implementation for previous platforms
      already covers the need for CNP expect for the pin pair configuration
      that follows similar definitions that we had on BXT.
      
      v2: Don't drop "_BXT" as the indicator of the first platform
          supporting this pin numbers. Suggested by Daniel.
      v3: Add missing else and fix register table since CNP GPIO_CTL
          starts on 0xC5014.
      v4: Fix pin number and map according to the current available VBT.
          Re-add pin 4 for port D. Lost during some rebase.
      v5: Use table as spec. If VBT is wrong it should be ignored.
      
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NAnusha Srivatsa <anusha.srivatsa@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1496434004-29812-5-git-send-email-rodrigo.vivi@intel.com
      3d02352c
    • R
      drm/i915/cnp: Get/set proper Raw clock frequency on CNP. · 9d81a997
      Rodrigo Vivi 提交于
      RAWCLK_FREQ register has changed for platforms with CNP+.
      
      [29:26] This field provides the denominator for the fractional
      	part of the microsecond counter divider.  The numerator
      	is fixed at 1. Program this field to the denominator of
      	the fractional portion of reference frequency minus one.
      	If the fraction is 0, program to 0.
      	0100b = Fraction .2 MHz = Fraction 1/5.
      	0000b = Fraction .0 MHz.
      
      [25:16] This field provides the integer part of the microsecond
      	counter divider. Program this field to the integer portion
      	of the reference frequenct minus one.
      
      Also this register tells us that proper raw clock should be read
      from SFUSE_STRAP and programmed to this register. Up to this point
      on other platforms we are reading instead of programming it so
      probably relying on whatever BIOS had configured here.
      
      Now on let's follow the spec and also program this register
      fetching the right value from SFUSE_STRAP as Spec tells us to do.
      
      v2: Read from SFUSE_STRAP and Program RAWCLK_FREQ instead of
          reading the value relying someone else will program that
          for us.
      v3: Add missing else. (Jani)
      v4: Addressing all Ville's catches:
          Use macro for shift bits instead of defining shift.
          Remove shift from the cleaning bits with mask that already
          has it.
          Add missing I915_WRITE to actually write the reg.
          Stop using useless DIV_ROUND_* on divider that is exact
          dividion and use DIV_ROUND_CLOSEST for the fraction part.
      v5: Remove useless Read-Modify-Write on raclk_freq reg. (Ville).
      v6: Change is per PCH instead of per platform.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1496434004-29812-3-git-send-email-rodrigo.vivi@intel.com
      9d81a997
  14. 30 5月, 2017 1 次提交
  15. 18 5月, 2017 2 次提交
  16. 15 5月, 2017 1 次提交
    • V
      drm/i915: Fix rawclk readout for g4x · 82f2b4ac
      Ville Syrjälä 提交于
      Turns out our skills in decoding the CLKCFG register weren't good
      enough. On this particular elk the answer we got was 400 MHz when
      in reality the clock was running at 266 MHz, which then caused us
      to program a bogus AUX clock divider that caused all AUX communication
      to fail.
      
      Sadly the docs are now in bit heaven, so the fix will have to be based
      on empirical evidence. Using another elk machine I was able to frob
      the FSB frequency from the BIOS and see how it affects the CLKCFG
      register. The machine seesm to use a frequency of 266 MHz by default,
      and fortunately it still boot even with the 50% CPU overclock that
      we get when we bump the FSB up to 400 MHz.
      
      It turns out the actual FSB frequency and the register have no real
      link whatsoever. The register value is based on some straps or something,
      but fortunately those too can be configured from the BIOS on this board,
      although it doesn't seem to respect the settings 100%. In the end I was
      able to derive the following relationship:
      
      BIOS FSB / strap | CLKCFG
      -------------------------
      200              | 0x2
      266              | 0x0
      333              | 0x4
      400              | 0x4
      
      So only the 200 and 400 MHz cases actually match how we're currently
      decoding that register. But as the comment next to some of the defines
      says, we have been just guessing anyway.
      
      So let's fix things up so that at least the 266 MHz case will work
      correctly as that is actually the setting used by both the buggy
      machine and my test machine.
      
      The fact that 333 and 400 MHz BIOS settings result in the same register
      value is a little disappointing, as that means we can't tell them apart.
      However, according to the gmch datasheet for both elk and ctg 400 Mhz is
      not even a supported FSB frequency, so I'm going to make the assumption
      that we should decode it as 333 MHz instead.
      
      Cc: stable@vger.kernel.org
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Reported-by: NTomi Sarvela <tomi.p.sarvela@intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100926Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170504181530.6908-1-ville.syrjala@linux.intel.comAcked-by: NJani Nikula <jani.nikula@intel.com>
      Tested-by: NTomi Sarvela <tomi.p.sarvela@intel.com>
      (cherry picked from commit 6f38123e)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      82f2b4ac
  17. 11 5月, 2017 1 次提交
    • V
      drm/i915: Support variable cursor height on ivb+ · 024faac7
      Ville Syrjälä 提交于
      IVB introduced the CUR_FBC_CTL register which allows reducing the cursor
      height down to 8 lines from the otherwise square cursor dimensions.
      Implement support for it. CUR_FBC_CTL can't be used when the cursor
      is rotated.
      
      Commandeer the otherwise unused cursor->cursor.size to track the
      current value of CUR_FBC_CTL to optimize away redundant CUR_FBC_CTL
      writes, and to notice when we need to arm the update via CURBASE if
      just CUR_FBC_CTL changes.
      
      v2: Reverse the gen check to make it sane
      v3: Only enable CUR_FBC_CTL when cursor is enabled, adapt to
          earlier code changes which means we now actually turn off
          the cursor when we're supposed to unlike v2
      v4: Add a comment about rotation vs. CUR_FBC_CTL,
          rebase due to 'dirty' (Chris)
      v5: Rebase to the atomic world
          Handle 180 degree rotation
          Add HAS_CUR_FBC()
      v6: Rebase
      v7: Rebase due to I915_WRITE_FW/uncore.lock
          s/size/fbc_ctl/
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170327185546.2977-12-ville.syrjala@linux.intel.comReviewed-by: NImre Deak <imre.deak@intel.com>
      024faac7
  18. 10 5月, 2017 1 次提交
  19. 06 5月, 2017 1 次提交
    • V
      drm/i915: Fix rawclk readout for g4x · 6f38123e
      Ville Syrjälä 提交于
      Turns out our skills in decoding the CLKCFG register weren't good
      enough. On this particular elk the answer we got was 400 MHz when
      in reality the clock was running at 266 MHz, which then caused us
      to program a bogus AUX clock divider that caused all AUX communication
      to fail.
      
      Sadly the docs are now in bit heaven, so the fix will have to be based
      on empirical evidence. Using another elk machine I was able to frob
      the FSB frequency from the BIOS and see how it affects the CLKCFG
      register. The machine seesm to use a frequency of 266 MHz by default,
      and fortunately it still boot even with the 50% CPU overclock that
      we get when we bump the FSB up to 400 MHz.
      
      It turns out the actual FSB frequency and the register have no real
      link whatsoever. The register value is based on some straps or something,
      but fortunately those too can be configured from the BIOS on this board,
      although it doesn't seem to respect the settings 100%. In the end I was
      able to derive the following relationship:
      
      BIOS FSB / strap | CLKCFG
      -------------------------
      200              | 0x2
      266              | 0x0
      333              | 0x4
      400              | 0x4
      
      So only the 200 and 400 MHz cases actually match how we're currently
      decoding that register. But as the comment next to some of the defines
      says, we have been just guessing anyway.
      
      So let's fix things up so that at least the 266 MHz case will work
      correctly as that is actually the setting used by both the buggy
      machine and my test machine.
      
      The fact that 333 and 400 MHz BIOS settings result in the same register
      value is a little disappointing, as that means we can't tell them apart.
      However, according to the gmch datasheet for both elk and ctg 400 Mhz is
      not even a supported FSB frequency, so I'm going to make the assumption
      that we should decode it as 333 MHz instead.
      
      Cc: stable@vger.kernel.org
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Reported-by: NTomi Sarvela <tomi.p.sarvela@intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100926Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170504181530.6908-1-ville.syrjala@linux.intel.comAcked-by: NJani Nikula <jani.nikula@intel.com>
      Tested-by: NTomi Sarvela <tomi.p.sarvela@intel.com>
      6f38123e
  20. 28 4月, 2017 1 次提交
    • J
      drm/i915: Sanitize engine context sizes · 63ffbcda
      Joonas Lahtinen 提交于
      Pre-calculate engine context size based on engine class and device
      generation and store it in the engine instance.
      
      v2:
      - Squash and get rid of hw_context_size (Chris)
      
      v3:
      - Move after MMIO init for probing on Gen7 and 8 (Chris)
      - Retained rounding (Tvrtko)
      v4:
      - Rebase for deferred legacy context allocation
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
      Cc: intel-gvt-dev@lists.freedesktop.org
      Acked-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      63ffbcda
  21. 11 4月, 2017 1 次提交