1. 14 2月, 2014 1 次提交
  2. 13 2月, 2014 1 次提交
  3. 28 1月, 2014 1 次提交
    • J
      drm/i915: move module parameters into a struct, in a new file · d330a953
      Jani Nikula 提交于
      With 20+ module parameters, I think referring to them via a struct
      improves clarity over just having a bunch of globals. While at it, move
      the parameter initialization and definitions into a new file
      i915_params.c to reduce clutter in i915_drv.c.
      
      Apart from the ill-named i915_enable_rc6, i915_enable_fbc and
      i915_enable_ppgtt parameters, for which we lose the "i915_" prefix
      internally, the module parameters now look the same both on the kernel
      command line and in code. For example, "i915.modeset".
      
      The downsides of the change are losing static on a couple of variables
      and not having the initialization and module_param_named() right next to
      each other. On the other hand, all module parameters are now defined in
      one place at i915_params.c. Plus you can do this to find all module
      parameter references:
      
      $ git grep "i915\." -- drivers/gpu/drm/i915
      
      v2:
      - move the definitions into a new file
      - s/i915_params/i915/
      - make i915_try_reset i915.reset, for consistency
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d330a953
  4. 10 12月, 2013 1 次提交
  5. 02 12月, 2013 1 次提交
    • D
      drm/i915/lvds: don't restore hw state in the lid notifier for pch platforms · 5be19d91
      Daniel Vetter 提交于
      It's a pain for two reasons:
      - The vga plane redisablign requires actual legacy vgao i/o to pull
        of. The hw engineers really botched this one here :(
      - There seem to be some BIOS out there which send out lid events when
        unplugging. Together with our broken DP code, which disables the
        port when the cable is lost, this results in an immediate modeset
        call, which can hang on the wait for outstanding flips.
      - Also we don't want to force a modeset on machines where it's not
        really needed, see the referenced bug.
      
      We might want to extend this in general to also all machines that
      support opregion, since there the BIOS supposedly should manage the
      gfx hardware more cooperatively.
      
      v2: Pimp commit message a bit.
      
      Cc: Roland Dreier <roland@kernel.org>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=65486Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5be19d91
  6. 28 11月, 2013 1 次提交
  7. 07 11月, 2013 1 次提交
    • J
      drm/i915: make backlight functions take a connector · 752aa88a
      Jesse Barnes 提交于
      On VLV/BYT, backlight controls a per-pipe, so when adjusting the
      backlight we need to pass the correct info.  So make the externally
      visible backlight functions take a connector argument, which can be used
      internally to figure out the pipe backlight to adjust.
      
      v2: make connector pipe lookup check for NULL crtc (Jani)
          fixup connector check in ASLE code (Jani)
      v3: make sure we take the mode config lock around lookups (Daniel)
      v4: fix double unlock in panel_get_brightness (Daniel)
      v5: push ASLE work into a work queue (Daniel)
      v6: separate ASLE work to a prep patch, rebase (Jani)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      752aa88a
  8. 29 10月, 2013 1 次提交
  9. 01 10月, 2013 4 次提交
    • P
      drm/i915: destroy connector sysfs files earlier · d9255d57
      Paulo Zanoni 提交于
      For some reason, every single time I try to run module_reload
      something tries to read the connector sysfs files. This happens
      after we destroy the encoders and before we destroy the connectors, so
      when the sysfs read triggers the connector detect() function,
      intel_conector->encoder points to memory that was already freed.
      
      The bad backtrace is just:
          [<ffffffff8163ca9a>] dump_stack+0x54/0x74
          [<ffffffffa00c2c8e>] intel_dp_detect+0x1e/0x4b0 [i915]
          [<ffffffffa001913d>] status_show+0x3d/0x80 [drm]
          [<ffffffff813d5340>] dev_attr_show+0x20/0x60
          [<ffffffff81221f50>] ? sysfs_read_file+0x80/0x1b0
          [<ffffffff81221f79>] sysfs_read_file+0xa9/0x1b0
          [<ffffffff811aaf1e>] vfs_read+0x9e/0x170
          [<ffffffff811aba4c>] SyS_read+0x4c/0xa0
          [<ffffffff8164e392>] system_call_fastpath+0x16/0x1b
      
      But if you add tons of memory checking debug options to your Kernel
      you'll also see:
       - general protection fault: 0000
       - BUG kmalloc-4096 (Tainted: G      D W   ): Poison overwritten
       - INFO: Allocated in intel_ddi_init+0x65/0x270 [i915]
       - INFO: Freed in intel_dp_encoder_destroy+0x69/0xb0 [i915]
      Among a bunch of other error messages.
      
      So this commit just destroys the sysfs files before both the encoder
      and connectors are freed.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d9255d57
    • D
      drm/i915: Use crtc_clock with the adjusted mode · 241bfc38
      Damien Lespiau 提交于
      struct drm_mode_display now has a separate crtc_ version of the clock to
      be used when we're talking about the timings given to the harwadre (was
      far as the mode is concerned).
      
      This commit is really the result of a git grep adjusted_mode.*clock and
      replacing those by adjusted_mode.crtc_clock. No functional change.
      
      v2: Rebased on drm-intel-queued-next
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Acked-by: NDave Airlie <airlied@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      241bfc38
    • 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
    • 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
  10. 17 9月, 2013 1 次提交
    • V
      drm/i915: Fix port_clock and adjusted_mode.clock readout all over · 18442d08
      Ville Syrjälä 提交于
      Now that adjusted_mode.clock no longer contains the pixel_multiplier, we
      can kill the get_clock() callback and instead do the clock readout
      in get_pipe_config().
      
      Also i9xx_crtc_clock_get() can now extract the frequency of the PCH
      DPLL, so use it to populate port_clock accurately for PCH encoders.
      For DP in port A the encoder is still responsible for filling in
      port_clock. The FDI adjusted_mode.clock extraction is kept in place
      for some extra sanity checking, but we no longer need to pretend it's
      also the port_clock.
      
      In the encoder get_config() functions fill out adjusted_mode.clock
      based on port_clock and other details such as the DP M/N values,
      HDMI 12bpc and SDVO pixel_multiplier. For PCH encoders we will then
      do an extra sanity check to make sure the dotclock we derived from
      the FDI configuratiuon matches the one we derive from port_clock.
      
      DVO doesn't exist on PCH platforms, so it doesn't need to anything
      but assign adjusted_mode.clock=port_clock. And DDI is HSW only, so
      none of the changes apply there.
      
      v2: Use hdmi_reg color format to detect 12bpc HDMI case
      v3: Set adjusted_mode.clock for LVDS too
      v4: Rename ironlake_crtc_clock_get to ironlake_pch_clock_get,
          eliminate the useless link_freq variable.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      18442d08
  11. 04 9月, 2013 1 次提交
    • V
      drm/i915: Fix pipe config warnings when dealing with LVDS fixed mode · 4c6df4b4
      Ville Syrjälä 提交于
      intel_fixed_panel_mode() overwrote the adjusted_mode with the fixed mode
      only partially. Notably it forgot to copy over the sync flags. The LVDS code however programmed the hardware with the sync flags from fixed mode, and then later the pipe config comparison obviously failed as we
      filled out the adjusted_mode in get_config from the real registers.
      
      Just call drm_mode_copy() in intel_fixed_panel_mode() to copy over the
      whole thing, and then just use adjusted_mode in the LVDS code to figure
      out which sync settings the hardware needs.
      
      Also constify the fixed_mode argument to intel_fixed_panel_mode().
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4c6df4b4
  12. 05 8月, 2013 1 次提交
  13. 24 7月, 2013 1 次提交
  14. 13 7月, 2013 1 次提交
    • D
      drm/i915: fix pfit regression for non-autoscaled resolutions · 21d8a475
      Daniel Vetter 提交于
      I.e. for letter/pillarboxing. For those cases we need to adjust the
      mode a bit, but Jesse gmch pfit refactoring in
      
      commit 2dd24552
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Thu Apr 25 12:55:01 2013 -0700
      
          drm/i915: factor out GMCH panel fitting code and use for eDP v3
      
      broke that by reordering the computation of the gmch pfit state with
      the block of code that prepared the adjusted mode for it and told the
      modeset core not to overwrite the adjusted mode with default settings.
      
      We might want to switch around the core code to just fill in defaults,
      but this code predates the pipe_config modeset rework. And in the old
      crtc helpers we did not have a suitable spot to do this.
      
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Hans de Bruin <jmdebruin@xmsnet.nl>
      Reported-and-tested-by: NHans de Bruin <jmdebruin@xmsnet.nl>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      21d8a475
  15. 12 7月, 2013 1 次提交
    • D
      drm/i915: fix up readout of the lvds dither bit on gen2/3 · 06922821
      Daniel Vetter 提交于
      It's in the PFIT_CONTROL register, but very much associated with the
      lvds encoder. So move the readout for it (in the case of an otherwise
      disabled pfit) from the pipe to the lvds encoder's get_config
      function.
      
      Otherwise we get a pipe state mismatch if we use pipe B for a non-lvds
      output and we've left the dither bit enabled behind us. This can
      happen if the BIOS has set the bit (some seem to unconditionally do
      that, even in the complete absence of an lvds port), but not enabled
      pipe B at boot-up. Then we won't clear the pfit control register since
      we can only touch that if the pfit is associated with our pipe in the
      crtc configuration - we could trample over the pfit state of the other
      pipe otherwise since it's shared. Once pipe B is enabled we notice
      that the 6to8 dither bit is set and complain about the mismatch.
      
      Note that testing indicates that we don't actually need to set this
      bit when the pfit is disabled, dithering on 18bpp panels seems to work
      regardless. But ripping that code out is not something for a bugfix
      meant for -rc kernels.
      
      v2: While at it clarify the logic in i9xx_get_pfit_config, spurred by
      comments from Chris on irc.
      
      v3: Use Chris suggestion to make the control flow in
      i9xx_get_pfit_config easier to understand.
      
      v4: Kill the extra line, spotted by Chris.
      Reported-by: NKnut Petersen <Knut_Petersen@t-online.de>
      Cc: Knut Petersen <Knut_Petersen@t-online.de>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      References: http://lists.freedesktop.org/archives/intel-gfx/2013-July/030092.htmlTested-by: NKnut Petersen <Knut_Petersen@t-online.de>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      06922821
  16. 04 7月, 2013 2 次提交
  17. 01 7月, 2013 2 次提交
  18. 18 6月, 2013 1 次提交
    • D
      drm/i915: stop killing pfit on i9xx · c9093354
      Daniel Vetter 提交于
      Nowadays (i.e. with Valleyview) we also have edp on non-PCH_SPLIT
      platforms, so just checking for LVDS is not good enough.
      
      Secondly we have full pfit pipe config tracking, so we'll correctly
      disable the pfit as part of the initial modeset.
      
      For fastboot we need a bit of work here to correctly kill unsupported
      configs (if e.g. the pfit is used on anything else than the built-in
      panel). But since that's not yet supported we don't need to worry.
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c9093354
  19. 05 6月, 2013 1 次提交
    • D
      drm/i915: consolidate and tighten encoder cloning checks · accfc0c5
      Daniel Vetter 提交于
      Only lvds/tv did actually check for cloning or not, but many more
      places should.
      
      Notices because my ivb tried to enable both cpu edp and vga on the
      first crtc - the resulting confusion between has_pch_encoder,
      has_dp_encoder but not actually being a pch dp encoder resulting in
      hilarity (hitting a BUG).
      
      We _really_ need an igt to random-walk our modeset space more
      exhaustively.
      
      The bug seems to have been exposed due to a race in the hw load
      detection support for VGA: Right after a hotplug VGA was still
      detected as connected, but obviously reading the EDID wasn't possible
      any more. Hence why restarting X a bit later fixed things. Due to the
      1024x756 fallback resolution suddenly more outputs had the same
      resolution.
      
      On top of that SNA was confused with the possible_clones mask, trying
      to clone outputs which cannot be cloned. That bug is now fixed with
      
      commit fc1e0702b25e647cb423851fb7228989fec28bd6
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed May 29 11:25:28 2013 +0100
      
          sna: fixup up possible_clones kms->X impedance mismatch
      
      v2: Kill intel_encoder_check_is_cloned, spotted by Paulo.
      
      v3: Drop the now unused pipe param.
      
      v4: Kill the stray printk Chris spotted.
      
      v5: Elaborate on how the bug in userspace happened and why it was racy
      to reproduce.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      accfc0c5
  20. 03 6月, 2013 1 次提交
  21. 21 5月, 2013 1 次提交
    • J
      drm/i915: add encoder get_config function v5 · 045ac3b5
      Jesse Barnes 提交于
      We can use this for fetching encoder specific pipe_config state, like
      mode flags, adjusted clock, etc.
      
      Just used for mode flags atm, so we can check the pipe config state at
      mode set time.
      
      v2: get_config when checking hw state too
      v3: fix DVO and LVDS mode flags (Ville)
          get SDVO DTD for flag fetch (Ville)
      v4: use input timings (Ville)
          correct command used (Ville)
          remove gen4 check (Ville)
      v5: get DDI flag config too
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v4)
      Tested-by: Paulo Zanoni <przanoni@gmail.com> (the new hsw ddi stuff)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      045ac3b5
  22. 15 5月, 2013 1 次提交
    • D
      drm/i915: panel fitter hw state readout&check support · 2fa2fe9a
      Daniel Vetter 提交于
      Pfit state readout is a bit ugly on gen2/3 due to the intermingling
      with the lvds state, but alas.
      
      Also note that since state is always cleared to zero we can
      unconditonally compare all the state and completely neglect the actual
      platform we're running on.
      
      v2: Properly check for the pfit power domain on haswell.
      
      v3: Don't check pgm_ratios on gen4+, they're auto-computed by the hw.
      
      v4: Properly clear the lvds border bits, upset the state checker a
      bit.
      
      v5: Unconditionally read out panel dither settings on gen2/3.
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2fa2fe9a
  23. 11 5月, 2013 1 次提交
  24. 30 4月, 2013 3 次提交
    • D
      drm/i915: move border color writes to pfit_enable · 5a80c45c
      Daniel Vetter 提交于
      Writing hw registers from compute_config?
      Just say no!
      
      In this case not too horrible since we write a constant 0, and only
      debugging would put something else in there. But while checking that
      code I've noticed that this register disappeared on pch platforms, so
      fix that up, too.
      
      And adjust the comment a bit, it's outdated.
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5a80c45c
    • D
      drm/i915: move lvds_border_bits to pipe_config · 68fc8742
      Daniel Vetter 提交于
      pipe_config is the new dev_priv!
      
      More seriously, this is actually better since a pipe_config can be
      thrown away if the modeset compute config stage fails. Whereas any
      state stored in dev_prive needs to be painstakingly restored, since
      otherwise a dpms off/on will wreak massive havoc. Yes, that even
      applies to state only used in ->mode_set callbacks, since we need to
      call those even for dpms on when the Haswell power well cleared
      everything out.
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      68fc8742
    • D
      drm/i915: implement fdi auto-dithering · e29c22c0
      Daniel Vetter 提交于
      So on a bunch of setups we only have 2 fdi lanes available, e.g. hsw
      VGA or 3 pipes on ivb. And seemingly a lot of modes don't quite fit
      into this, among them the default 1080p mode.
      
      The solution is to dither down the pipe a bit so that everything fits,
      which this patch implements.
      
      But ports compute their state under the assumption that the bpp they
      pick will be the one selected, e.g. the display port bw computations
      won't work otherwise. Now we could adjust our code to again up-dither
      to the computed DP link parameters, but that's pointless.
      
      So instead when the pipe needs to adjust parameters we need to retry
      the pipe_config computation at the encoder stage. Furthermore we need
      to inform encoders that they should not increase bandwidth
      requirements if possible. This is required for the hdmi code, which
      prefers the pipe to up-dither to either of the two possible hdmi bpc
      values.
      
      LVDS has a similar requirement, although that's probably only
      theoretical in nature: It's unlikely that we'll ever see an 8bpc
      high-res lvds panel (which is required to hit the 2 fdi lane limit).
      
      eDP is the only thing which could increase the pipe_bpp setting again,
      even when in the retry-loop. This could hit the WARN. Two reasons for
      not bothering:
      - On many eDP panels we'll get a black screen if the bpp settings
        don't match vbt. So failing the modeset is the right thing to do.
        But since that also means it's the only way to light up the panel,
        it should work. So we shouldn't be able to hit this WARN.
      - There are still opens around the eDP panel handling, and maybe we
        need additional tricks. Before that happens it's imo no use trying
        to be too clever.
      Worst case we just need to kill that WARN or maybe fail the compute
      config stage if the eDP connector can't get the bpp setting it wants.
      And since this can only happen with an fdi link in between and so for
      pch eDP panels it's rather unlikely to blow up, if ever.
      
      v2: Rebased on top of a bikeshed from Paulo.
      
      v3: Improve commit message around eDP handling with the stuff
      things with Imre.
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e29c22c0
  25. 26 4月, 2013 3 次提交
    • J
      drm/i915: move PCH pfit controls into pipe_config · b074cec8
      Jesse Barnes 提交于
      And put the pfit stuff into substructs while we're at it.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b074cec8
    • J
      drm/i915: factor out GMCH panel fitting code and use for eDP v3 · 2dd24552
      Jesse Barnes 提交于
      This gets the panel fitter working on eDP on VLV, and should also apply
      to eDP panels on G4x chipsets (if we ever detect and mark an all-in-one
      panel as eDP anyway).
      
      A few cleanups are still possible on top of this, for example the LVDS
      border control could be placed in the LVDS encoder structure and updated
      based on the result of the panel fitter calculation.
      
      Multi-pipe fitting isn't handled correctly either if we ever get a config
      that wants to try the panel fitter on more than one output at a time.
      
      v2: use pipe_config for storing pfit values (Daniel)
          add i9xx_pfit_enable function for use by 9xx and VLV (Daniel)
      v3: fixup conflicts and lvds_dither check
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: fix up botched conflict resolution from Jesse:
      - border = LVDS_BORDER_ENABLE was lost for CENTER scaling
      - comment about gen2/3 panel fitter scaling was lost
      - dev_priv->lvds_dither reintroduced.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2dd24552
    • D
      drm/i915: use pipe_config for lvds dithering · d8b32247
      Daniel Vetter 提交于
      Up to now we've relied on the bios to get this right for us. Let's try
      out whether our code has improved a bit, since we should dither
      always when the output bpp doesn't match the plane bpp.
      - gen5+ should be fine, since we only use the bios hint as an upgrade.
      - gen4 changes, since here dithering is still controlled in the lvds
        register.
      - gen2/3 has implicit dithering depeding upon whether you use 2 or 3
        lvds pairs (which makes sense, since it only supports 8bpc pipe
        outpu configurations).
      - hsw doesn't support lvds.
      
      v2: Remove redudant dither setting.
      
      v3: Completly drop reliance on dev_priv->lvds_dither.
      
      v4: Enable dithering on gen2/3 only when we have a 18bpp panel, since
      up-dithering to a 24bpp panel is not supported by the hw. Spotted by
      Ville.
      
      v5: Also only enable lvds port dithering on gen4 for 18bpp modes. In
      practice this only excludes dithering a 10bpc plane down for a 24bpp
      lvds panel. Not something we truly care about. Again noticed by Ville.
      
      v6: Actually git add.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d8b32247
  26. 18 4月, 2013 2 次提交
  27. 06 4月, 2013 1 次提交
  28. 28 3月, 2013 3 次提交
    • D
      drm/i915: precompute pipe bpp before touching the hw · 4e53c2e0
      Daniel Vetter 提交于
      The procedure has now 3 steps:
      
      1. Compute the bpp that the plane will output, this is done in
         pipe_config_set_bpp and stored into pipe_config->pipe_bpp. Also,
         this function clamps the pipe_bpp to whatever limit the EDID of any
         connected output specifies.
      2. Adjust the pipe_bpp in the encoder and crtc functions, according to
         whatever constraints there are.
      3. Decide whether to use dither by comparing the stored plane bpp with
         computed pipe_bpp.
      
      There are a few slight functional changes in this patch:
      - LVDS connector are now also going through the EDID clamping. But in
        a 2nd change we now unconditionally force the lvds bpc value - this
        shouldn't matter in reality when the panel setup is consistent, but
        better safe than sorry.
      - HDMI now forces the pipe_bpp to the selected value - I think that's
        what we actually want, since otherwise at least the pixelclock
        computations are wrong (I'm not sure whether the port would accept
        e.g. 10 bpc when in 12bpc mode). Contrary to the old code, we pick
        the next higher bpc value, since otherwise there's no way to make
        use of the 12 bpc mode (since the next patch will remove the 12bpc
        plane format, it doesn't exist).
      
      Both of these changes are due to the removal of the
      
      	pipe_bpp = min(display_bpp, plane_bpp);
      
      statement.
      
      Another slight change is the reworking of the dp bpc code:
      - For the mode_valid callback it's sufficient to only check whether
        the mode would fit at the lowest bpc.
      - The bandwidth computation code is a bit restructured: It now walks
        all available bpp values in an outer loop and the codeblock that
        computes derived values (once a good configuration is found) has been
        moved out of the for loop maze. This is prep work to allow us to
        successively fall back on bpc values, and also correctly support bpc
        values != 8 or 6.
      
      v2: Rebased on top of Paulo Zanoni's little refactoring to use more
      drm dp helper functions.
      
      v3: Rebased on top of Jani's eDP bpp fix and Ville's limited color
      range work.
      
      v4: Remove the INTEL_MODE_DP_FORCE_6BPC #define, no longer needed.
      
      v5: Remove intel_crtc->bpp, too, and fix up the 12bpc check in the
      hdmi code. Also fixup the bpp check in intel_dp.c, it'll get reworked
      in a later patch though again.
      
      v6: Fix spelling in a comment.
      
      v7: Debug output improvements for the bpp computation.
      
      v8: Fixup 6bpc lvds check - dual-link and 8bpc mode are different
      things!
      
      v9: Reinstate the fix to properly ignore the firmware edp bpp ... this
      was lost in a rebase.
      
      v10: Both g4x and vlv lack 12bpc pipes, so don't enforce that we have
      that. Still unsure whether this is the way to go, but at least 6bpc
      for a 8bpc hdmi output seems to work.
      
      v11: And g4x/vlv also lack 12bpc hdmi support, so only support high
      depth on DP. Adjust the code.
      
      v12: Rebased.
      
      v13: Split out the introduction of pipe_config->dither|pipe_bpp, as
      requested from Jesse Barnes.
      
      v14: Split out the special 6BPC handling for DP, as requested by Jesse
      Barnes.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4e53c2e0
    • D
      drm/i915: add pipe_config->has_pch_encoder · 5bfe2ac0
      Daniel Vetter 提交于
      This is used way too often in the enable/disable paths. And will
      be even more useful in the future.
      
      Note that correct semantics of this change highly depend upon
      correct updating of intel_crtc->config: Like with all other
      modeset state, we need to call ->disable with the old config,
      but ->mode_set and ->enable with the new config.
      
      v2: Do not yet use the flag in the ->disable callbacks - atm we don't
      yet have support for the information stored in the pipe_config in the
      hw state readout code, so this will be wrong at boot-up/resume.
      
      v3: Rebased on top of the hdmi/dp ddi encoder merging.
      
      v4: Fixup stupid rebase error which lead to a NULL vfunc deref.
      
      v5: On haswell the VGA port is on the PCH!
      
      v6: s/IS_HASWELL/HAS_DDI/, spotted by Paulo Zanoni. Also add a missing
      parameter name in a function declaration.
      
      v7: Don't forget to git add ...
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5bfe2ac0
    • D
      drm/i915: add pipe_config->timings_set · 7ae89233
      Daniel Vetter 提交于
      Only used by the lvds encoder. Note that we shouldn't do the same
      simple conversion with the FORCE_6BPC flag, since that's much better
      handled by moving all the pipe_bpc computation around.
      
      This requires that we pass the pipe config around to encoders, so
      that they can set special attributes and set constraints. To do so
      introduce a new ->compute_config encoder callback, which is called in
      stead of the drm crtc helper's ->mode_fixup.
      
      To avoid massive churn all over the codebase we don't want to convert
      all existing ->mode_fixup functions. Instead I've opted to convert
      them on an as-needed basis (mostly to cut down on rebase conflicts and
      to have more freedom to experiment around while developing the
      patches).
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7ae89233