1. 01 3月, 2010 2 次提交
    • D
      vga_switcheroo: fix build on platforms with no ACPI · 8edb381d
      Dave Airlie 提交于
      radeon was always including the atpx code unnecessarily, also core
      switcheroo was including acpi headers.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8edb381d
    • D
      vga_switcheroo: initial implementation (v15) · 6a9ee8af
      Dave Airlie 提交于
      Many new laptops now come with 2 gpus, one to be used for low power
      modes and one for gaming/on-ac applications. These GPUs are typically
      wired to the laptop panel and VGA ports via a multiplexer unit which
      is controlled via ACPI methods.
      
      4 combinations of systems typically exist - with 2 ACPI methods.
      Intel/ATI - Lenovo W500/T500 - use ATPX ACPI method
      ATI/ATI - some ASUS - use ATPX ACPI Method
      Intel/Nvidia - - use _DSM ACPI method
      Nvidia/Nvidia -  - use _DSM ACPI method.
      
      TODO:
      This patch adds support for the ATPX method and initial bits
      for the _DSM methods that need to written by someone with
      access to the hardware.
      Add a proper non-debugfs interface - need to get some proper
      testing first.
      
      v2: add power up/down support for both devices
      on W500 puts i915/radeon into D3 and cuts power to radeon.
      
      v3: redo probing methods, no DMI list, drm devices call to
      register with switcheroo, it tries to find an ATPX method on
      any device and once there is two devices + ATPX it inits the
      switcher.
      
      v4: ATPX msg handling using buffers - should work on more machines
      
      v5: rearchitect after more mjg59 discussion - move ATPX handling to
          radeon driver.
      
      v6: add file headers + initial nouveau bits (to be filled out).
      
      v7: merge delayed switcher code.
      
      v8: avoid suspend/resume of gpu that is off
      
      v9: rearchitect - mjg59 is always right. - move all ATPX code to
      radeon, should allow simpler DSM also proper ATRM handling
      
      v10: add ATRM support for radeon BIOS, add mutex to lock vgasr_priv
      
      v11: fix bug in resuming Intel for 2nd time.
      
      v12: start fixing up nvidia code blindly.
      
      v13: blindly guess at finishing nvidia code
      
      v14: remove radeon audio hacks - fix up intel resume more like upstream
      
      v15: clean up printks + remove unnecessary igd/dis pointers
      
      mount debugfs
      
      /sys/kernel/debug/vgaswitcheroo/switch - should exist if ATPX detected
       + 2 cards.
      
      DIS - immediate change to discrete
      IGD - immediate change to IGD
      DDIS - delayed change to discrete
      DIGD - delayed change to IGD
      ON - turn on not in use
      OFF - turn off not in use
      
      Tested on W500 (Intel/ATI) and T500 (Intel/ATI)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      6a9ee8af
  2. 23 2月, 2010 2 次提交
  3. 18 2月, 2010 3 次提交
  4. 16 2月, 2010 1 次提交
    • J
      drm/radeon/kms: fix indirect buffer management V2 · e821767b
      Jerome Glisse 提交于
      There is 3 different distinct states for an indirect buffer (IB) :
        1- free with no fence
        2- free with a fence
        3- non free (fence doesn't matter)
      Previous code mixed case 2 & 3 in a single one leading to possible
      catastrophique failure. This patch rework the handling and properly
      separate each case. So when you get ib we set the ib as non free and
      fence status doesn't matter. Fence become active (ie has a meaning
      for the ib code) once the ib is scheduled or free. This patch also
      get rid of the alloc bitmap as it was overkill, we know go through
      IB pool list like in a ring buffer as the oldest IB is the first
      one the will be free.
      
      Fix :
      https://bugs.freedesktop.org/show_bug.cgi?id=26438
      and likely other bugs.
      
      V2 remove the scheduled list, it's useless now, fix free ib scanning
      Signed-off-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e821767b
  5. 11 2月, 2010 2 次提交
    • D
      drm/radeon/kms: set gart pages to invalid on unbind and point to dummy page · 82568565
      Dave Airlie 提交于
      this uses a new entrypoint to invalidate gart entries instead of using 0.
      Changed to rather than pointing to 0 address point empty entry to dummy
      page. This might help to avoid hard lockup if for some wrong
      reasons GPU try to access unmapped GART entry.
      
      I'm not 100% sure this is going to work, we probably need to allocate
      a dummy page and point all the GTT entries at it similiar to what AGP does.
      but we can test this first I suppose.
      Signed-off-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      82568565
    • J
      drm/radeon/kms: r600/r700 command stream checker · 961fb597
      Jerome Glisse 提交于
      This patch add cs checker to r600/r700 hw. Command stream checking
      will rewrite some of the cs value in order to restrict GPU access
      to BO size. This doesn't break old userspace but just enforce safe
      value. It should break any things that was using the r600/r700 cs
      ioctl to do forbidden things (malicious software), though we are
      not aware of such things.
      
      Here is the list of thing we check :
      - enforcing resource size
      - enforcing color buffer slice tile max, will restrict cb access
      - enforcing db buffer slice tile max, will restrict db access
      
      We don't check for shader bigger than the BO in which they are
      supposed to be, such use would lead to GPU lockup and is harmless
      from security POV, as far as we can tell (note that even checking
      for this wouldn't prevent someone to write bogus shader that lead
      to lockup).
      
      This patch has received as much testing as humanly possible with
      old userspace to check that it didn't break such configuration.
      However not all the applications out there were tested, thus it
      might broke some odd, rare applications.
      
      [airlied: fix rules for cs checker for parallel builds]
      Signed-off-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      961fb597
  6. 09 2月, 2010 11 次提交
  7. 05 2月, 2010 2 次提交
  8. 01 2月, 2010 1 次提交
  9. 21 1月, 2010 3 次提交
    • J
      drm/radeon: r6xx/r7xx possible security issue, system ram access · c8c15ff1
      Jerome Glisse 提交于
      This patch workaround a possible security issue which can allow
      user to abuse drm on r6xx/r7xx hw to access any system ram memory.
      This patch doesn't break userspace, it detect "valid" old use of
      CB_COLOR[0-7]_FRAG & CB_COLOR[0-7]_TILE registers and overwritte
      the address these registers are pointing to with the one of the
      last color buffer. This workaround will work for old mesa &
      xf86-video-ati and any old user which did use similar register
      programming pattern as those (we expect that there is no others
      user of those ioctl except possibly a malicious one). This patch
      add a warning if it detects such usage, warning encourage people
      to update their mesa & xf86-video-ati. New userspace will submit
      proper relocation.
      
      Fix for xf86-video-ati / mesa (this kernel patch is enough to
      prevent abuse, fix for userspace are to set proper cs stream and
      avoid kernel warning) :
      http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=95d63e408cc88b6934bec84a0b1ef94dfe8bee7b
      http://cgit.freedesktop.org/mesa/mesa/commit/?id=46dc6fd3ed5ef96cda53641a97bc68c3bc104a9f
      
      Abusing this register to perform system ram memory is not easy,
      here is outline on how it could be achieve. First attacker must
      have access to the drm device and be able to submit command stream
      throught cs ioctl. Then attacker must build a proper command stream
      for r6xx/r7xx hw which will abuse the FRAG or TILE buffer to
      overwrite the GPU GART which is in VRAM. To achieve so attacker
      as to setup CB_COLOR[0-7]_FRAG or CB_COLOR[0-7]_TILE to point
      to the GPU GART, then it has to find a way to write predictable
      value into those buffer (with little cleverness i believe this
      can be done but this is an hard task). Once attacker have such
      program it can overwritte GPU GART to program GPU gart to point
      anywhere in system memory. It then can reusse same method as he
      used to reprogram GART to overwritte the system ram through the
      GART mapping. In the process the attacker has to be carefull to
      not overwritte any sensitive area of the GART table, like ring
      or IB gart entry as it will more then likely lead to GPU lockup.
      Bottom line is that i think it's very hard to use this flaw
      to get system ram access but in theory one can achieve so.
      
      Side note: I am not aware of anyone ever using the GPU as an
      attack vector, nevertheless we take great care in the opensource
      driver to try to detect and forbid malicious use of GPU. I don't
      think the closed source driver are as cautious as we are.
      Signed-off-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@linux.ie>
      c8c15ff1
    • J
      drm/radeon/kms: r600/r700 disable irq at suspend · 0c45249f
      Jerome Glisse 提交于
      To avoid hw doing anythings after we disabled PCIE GART, fully
      disable IRQ at suspend. Also cleanup a bit the ih structure
      and process function.
      Signed-off-by: NJerome Glisse <jglisse@redhat.com>
      Reviewed-by: NAlex Deucher <alexdeucher@gmail.com>
      Signed-off-by: NDave Airlie <airlied@linux.ie>
      0c45249f
    • A
      drm/radeon/kms: fix hardcoded mmio size in register functions · 07bec2df
      Alex Deucher 提交于
      newer asics have large mmio apertures
      Signed-off-by: NAlex Deucher <alexdeucher@gmail.com>
      Signed-off-by: NDave Airlie <airlied@linux.ie>
      07bec2df
  10. 14 1月, 2010 1 次提交
  11. 08 1月, 2010 3 次提交
  12. 23 12月, 2009 1 次提交
  13. 16 12月, 2009 2 次提交
  14. 10 12月, 2009 2 次提交
  15. 08 12月, 2009 4 次提交