1. 06 Jan, 2012 4 commits
    • Konrad Rzeszutek Wilk's avatar
      drm/ttm/dma: Only call set_pages_array_wb when the page is not in WB pool. · 36d7c537
      Konrad Rzeszutek Wilk authored
      Otherwise we are doing redundant work. Especially since the 'unbind'
      and 'unpopulate' have been merged and nouveau driver ends up calling
      it quite excessivly. On a GeForce 8600 GT with Gnome Shell (GNOME 3)
      we end up spending about 54% CPU time in __change_page_attr_set_clr
      checking the page flags.
      
      The callgraph (annotated) looks as so before this patch:
      
          53.29%  gnome-shell  [kernel.kallsyms]                   [k] static_protections
                  |
                  --- static_protections
                     |
                     |--91.80%-- __change_page_attr_set_clr
                     |          change_page_attr_set_clr
                     |          set_pages_array_wb
                     |          |
                     |          |--96.55%-- ttm_dma_unpopulate
                     |          |          nouveau_ttm_tt_unpopulate
                     |          |          ttm_tt_destroy
                     |          |          ttm_bo_cleanup_memtype_use
                     |          |          ttm_bo_release
                     |          |          kref_put
                     |          |          ttm_bo_unref
                     |          |          nouveau_gem_object_del
                     |          |          drm_gem_object_free
                     |          |          kref_put
                     |          |          drm_gem_object_unreference_unlocked
                     |          |          drm_gem_object_handle_unreference_unlocked.part.1
                     |          |          drm_gem_handle_delete
                     |          |          drm_gem_close_ioctl
                     |          |          drm_ioctl
                     |          |          do_vfs_ioctl
                     |          |          sys_ioctl
                     |          |          system_call_fastpath
                     |          |          __GI___ioctl
                     |          |
                     |           --3.45%-- ttm_dma_pages_put
                     |                     ttm_dma_page_pool_free
                     |                     ttm_dma_unpopulate
                     |                     nouveau_ttm_tt_unpopulate
                     |                     ttm_tt_destroy
                     |                     ttm_bo_cleanup_memtype_use
                     |                     ttm_bo_release
                     |                     kref_put
                     |                     ttm_bo_unref
                     |                     nouveau_gem_object_del
                     |                     drm_gem_object_free
                     |                     kref_put
                     |                     drm_gem_object_unreference_unlocked
                     |                     drm_gem_object_handle_unreference_unlocked.part.1
                     |                     drm_gem_handle_delete
                     |                     drm_gem_close_ioctl
                     |                     drm_ioctl
                     |                     do_vfs_ioctl
                     |                     sys_ioctl
                     |                     system_call_fastpath
                     |                     __GI___ioctl
                     |
                      --8.20%-- change_page_attr_set_clr
                                set_pages_array_wb
                                |
                                |--93.76%-- ttm_dma_unpopulate
                                |          nouveau_ttm_tt_unpopulate
                                |          ttm_tt_destroy
                                |          ttm_bo_cleanup_memtype_use
                                |          ttm_bo_release
                                |          kref_put
                                |          ttm_bo_unref
                                |          nouveau_gem_object_del
                                |          drm_gem_object_free
                                |          kref_put
                                |          drm_gem_object_unreference_unlocked
                                |          drm_gem_object_handle_unreference_unlocked.part.1
                                |          drm_gem_handle_delete
                                |          drm_gem_close_ioctl
                                |          drm_ioctl
                                |          do_vfs_ioctl
                                |          sys_ioctl
                                |          system_call_fastpath
                                |          __GI___ioctl
                                |
                                 --6.24%-- ttm_dma_pages_put
                                           ttm_dma_page_pool_free
                                           ttm_dma_unpopulate
                                           nouveau_ttm_tt_unpopulate
                                           ttm_tt_destroy
                                           ttm_bo_cleanup_memtype_use
                                           ttm_bo_release
                                           kref_put
                                           ttm_bo_unref
                                           nouveau_gem_object_del
                                           drm_gem_object_free
                                           kref_put
                                           drm_gem_object_unreference_unlocked
                                           drm_gem_object_handle_unreference_unlocked.part.1
                                           drm_gem_handle_delete
                                           drm_gem_close_ioctl
                                           drm_ioctl
                                           do_vfs_ioctl
                                           sys_ioctl
                                           system_call_fastpath
                                           __GI___ioctl
      
      and after this patch all of that disappears.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      36d7c537
    • Alex Deucher's avatar
      drm/radeon/kms: sync across multiple rings when doing bo moves v3 · 3000bf39
      Alex Deucher authored
      We need to synchronize across rings when doing a bo move to make
      sure we the buffer is idle if it's in use by a different ring than
      the ring doing the move.
      
      v2: fix fence setup for bo moves
      
      v3: add missing ring lock/unlock
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      3000bf39
    • Christian König's avatar
      drm/radeon/kms: Add support for multi-ring sync in CS ioctl (v2) · 93504fce
      Christian König authored
      Use semaphores to sync buffers across rings in the CS
      ioctl.  Add a reloc flag to allow userspace to skip
      sync for buffers.
      
      agd5f: port to latest CS ioctl changes.
      
      v2: add ring lock/unlock to make sure changes hit the ring.
      Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      93504fce
    • Jerome Glisse's avatar
      drm/radeon: GPU virtual memory support v22 · 721604a1
      Jerome Glisse authored
      Virtual address space are per drm client (opener of /dev/drm).
      Client are in charge of virtual address space, they need to
      map bo into it by calling DRM_RADEON_GEM_VA ioctl.
      
      First 16M of virtual address space is reserved by the kernel.
      
      Once using 2 level page table we should be able to have a small
      vram memory footprint for each pt (there would be one pt for all
      gart, one for all vram and then one first level for each virtual
      address space).
      
      Plan include using the sub allocator for a common vm page table
      area and using memcpy to copy vm page table in & out. Or use
      a gart object and copy things in & out using dma.
      
      v2: agd5f fixes:
      - Add vram base offset for vram pages.  The GPU physical address of a
      vram page is FB_OFFSET + page offset.  FB_OFFSET is 0 on discrete
      cards and the physical bus address of the stolen memory on
      integrated chips.
      - VM_CONTEXT1_PROTECTION_FAULT_DEFAULT_ADDR covers all vmid's >= 1
      
      v3: agd5f:
      - integrate with the semaphore/multi-ring stuff
      
      v4:
      - rebase on top ttm dma & multi-ring stuff
      - userspace is now in charge of the address space
      - no more specific cs vm ioctl, instead cs ioctl has a new
        chunk
      
      v5:
      - properly handle mem == NULL case from move_notify callback
      - fix the vm cleanup path
      
      v6:
      - fix update of page table to only happen on valid mem placement
      
      v7:
      - add tlb flush for each vm context
      - add flags to define mapping property (readable, writeable, snooped)
      - make ring id implicit from ib->fence->ring, up to each asic callback
        to then do ring specific scheduling if vm ib scheduling function
      
      v8:
      - add query for ib limit and kernel reserved virtual space
      - rename vm->size to max_pfn (maximum number of page)
      - update gem_va ioctl to also allow unmap operation
      - bump kernel version to allow userspace to query for vm support
      
      v9:
      - rebuild page table only when bind and incrementaly depending
        on bo referenced by cs and that have been moved
      - allow virtual address space to grow
      - use sa allocator for vram page table
      - return invalid when querying vm limit on non cayman GPU
      - dump vm fault register on lockup
      
      v10: agd5f:
      - Move the vm schedule_ib callback to a standalone function, remove
        the callback and use the existing ib_execute callback for VM IBs.
      
      v11:
      - rebase on top of lastest Linus
      
      v12: agd5f:
      - remove spurious backslash
      - set IB vm_id to 0 in radeon_ib_get()
      
      v13: agd5f:
      - fix handling of RADEON_CHUNK_ID_FLAGS
      
      v14:
      - fix va destruction
      - fix suspend resume
      - forbid bo to have several different va in same vm
      
      v15:
      - rebase
      
      v16:
      - cleanup left over of vm init/fini
      
      v17: agd5f:
      - cs checker
      
      v18: agd5f:
      - reworks the CS ioctl to better support multiple rings and
      VM.  Rather than adding a new chunk id for VM, just re-use the
      IB chunk id and add a new flags for VM mode.  Also define additional
      dwords for the flags chunk id to define the what ring we want to use
      (gfx, compute, uvd, etc.) and the priority.
      
      v19:
      - fix cs fini in weird case of no ib
      - semi working flush fix for ni
      - rebase on top of sa allocator changes
      
      v20: agd5f:
      - further CS ioctl cleanups from Christian's comments
      
      v21: agd5f:
      - integrate CS checker improvements
      
      v22: agd5f:
      - final cleanups for release, only allow VM CS on cayman
      Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      721604a1
  2. 05 Jan, 2012 9 commits
  3. 03 Jan, 2012 26 commits
  4. 29 Dec, 2011 1 commit
    • Seung-Woo Kim's avatar
      drm/exynos: added hdmi display support · d8408326
      Seung-Woo Kim authored
      This patch is hdmi display support for exynos drm driver.
      
      There is already v4l2 based exynos hdmi driver in drivers/media/video/s5p-tv
      and some low level code is already in s5p-tv and even headers for register
      define are almost same. but in this patch, we decide not to consider separated
      common code with s5p-tv.
      
      Exynos HDMI is composed of 5 blocks, mixer, vp, hdmi, hdmiphy and ddc.
      
      1. mixer. The piece of hardware responsible for mixing and blending multiple
      data inputs before passing it to an output device.  The mixer is capable of
      handling up to three image layers. One is the output of VP.  Other two are
      images in RGB format.  The blending factor, and layers' priority are controlled
      by mixer's registers. The output is passed to HDMI.
      
      2. vp (video processor). It is used for processing of NV12/NV21 data.  An image
      stored in RAM is accessed by DMA. The output in YCbCr444 format is send to
      mixer.
      
      3. hdmi. The piece of HW responsible for generation of HDMI packets. It takes
      pixel data from mixer and transforms it into data frames. The output is send
      to HDMIPHY interface.
      
      4. hdmiphy. Physical interface for HDMI. Its duties are sending HDMI packets to
      HDMI connector. Basically, it contains a PLL that produces source clock for
      mixer, vp and hdmi.
      
      5. ddc (display data channel). It is dedicated i2c channel to exchange display
      information as edid with display monitor.
      
      With plane support, exynos hdmi driver fully supports two mixer layes and vp
      layer. Also vp layer supports multi buffer plane pixel formats having non
      contigus memory spaces.
      
      In exynos drm driver, common drm_hdmi driver to interface with drm framework
      has opertion pointers for mixer and hdmi. this drm_hdmi driver is registered as
      sub driver of exynos_drm. hdmi has hdmiphy and ddc i2c clients and controls
      them. mixer controls all overlay layers in both mixer and vp.
      
      Vblank interrupts for hdmi are handled by mixer internally because drm
      framework cannot support multiple irq id. And pipe number is used to check
      which display device irq happens.
      
      History
      v2: this version
       - drm plane feature support to handle overlay layers.
       - multi buffer plane pixel format support for vp layer.
       - vp layer support
      
      RFCv1: original
       - at https://lkml.org/lkml/2011/11/4/164Signed-off-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
      Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
      Signed-off-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      d8408326