1. 21 2月, 2013 1 次提交
  2. 04 1月, 2013 1 次提交
  3. 13 12月, 2012 1 次提交
  4. 05 12月, 2012 1 次提交
  5. 04 12月, 2012 5 次提交
    • I
      drm/exynos: add vm_ops to specific gem mmaper · 5b07c660
      Inki Dae 提交于
      Changelog v3:
      use drm_file's file object instead of gem object's
      - gem object's file represents the shmem storage so
        process-unique file object should be used instead.
      
      Changelog v2:
      call mutex_lock before drm_vm_open_locked is called.
      
      Changelog v1:
      This patch makes it takes a reference to gem object when
      specific gem mmap is requested. For this, it sets
      dev->driver->gem_vm_ops to vma->vm_ops.
      
      And this patch is based on exynos-drm-next-iommu branch of
      	git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynosSigned-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      5b07c660
    • I
      drm/exynos: add userptr feature for g2d module · 2a3098ff
      Inki Dae 提交于
      This patch adds userptr feautre for G2D module.
      
      The userptr means user space address allocated by malloc().
      And the purpose of this feature is to make G2D's dma able
      to access the user space region.
      
      To user this feature, user should flag G2D_BUF_USRPTR to
      offset variable of struct drm_exynos_g2d_cmd and fill
      struct drm_exynos_g2d_userptr with user space address
      and size for it and then should set a pointer to
      drm_exynos_g2d_userptr object to data variable of struct
      drm_exynos_g2d_cmd. The last bit of offset variable is used
      to check if the cmdlist's buffer type is userptr or not.
      If userptr, the g2d driver gets user space address and size
      and then gets pages through get_user_pages().
      (another case is counted as gem handle)
      
      Below is sample codes:
      
      static void set_cmd(struct drm_exynos_g2d_cmd *cmd,
      		unsigned long offset, unsigned long data)
      {
      	cmd->offset = offset;
      	cmd->data = data;
      }
      
      static int solid_fill_test(int x, int y, unsigned long userptr)
      {
      	struct drm_exynos_g2d_cmd cmd_gem[5];
      	struct drm_exynos_g2d_userptr g2d_userptr;
      	unsigned int gem_nr = 0;
      	...
      
      	g2d_userptr.userptr = userptr;
      	g2d_userptr.size = x * y * 4;
      
      	set_cmd(&cmd_gem[gem_nr++], DST_BASE_ADDR_REG |
      					G2D_BUF_USERPTR,
      			(unsigned long)&g2d_userptr);
      	...
      }
      
      int main(int argc, char **argv)
      {
      	unsigned long addr;
      	...
      
      	addr = malloc(x * y * 4);
      	...
      
      	solid_fill_test(x, y, addr);
      	...
      }
      
      And next, the pages are mapped with iommu table and the device
      address is set to cmdlist so that G2D's dma can access it.
      As you may know, the pages from get_user_pages() are pinned.
      In other words, they CAN NOT be migrated and also swapped out.
      So the dma access would be safe.
      
      But the use of userptr feature has performance overhead so
      this patch also has memory pool to the userptr feature.
      Please, assume that user sends cmdlist filled with userptr
      and size every time to g2d driver, and the get_user_pages
      funcion will be called every time.
      
      The memory pool has maximum 64MB size and the userptr that
      user had ever sent, is holded in the memory pool.
      This meaning is that if the userptr from user is same as one
      in the memory pool, device address to the userptr in the memory
      pool is set to cmdlist.
      
      And last, the pages from get_user_pages() will be freed once
      user calls free() and the dma access is completed. Actually,
      get_user_pages() takes 2 reference counts if the user process
      has never accessed user region allocated by malloc(). Then, if
      the user calls free(), the page reference count becomes 1 and
      becomes 0 with put_page() call. And the reverse holds as well.
      This means how the pages backed are used by dma and freed.
      
      This patch is based on "drm/exynos: add iommu support for g2d",
      	https://patchwork.kernel.org/patch/1629481/Signed-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      2a3098ff
    • R
      drm: exynos: fix for mapping of dma buffers · 4ddc404b
      Rahul Sharma 提交于
      This patch fixes the problem of mapping contigous and non contigous dma buffers.
      
      Currently page struct is calculated from the buf->dma_addr which is not the
      physical address. It is replaced by buf->pages which points to the page struct
      of the first page of contigous memory chunk. This gives the correct page frame
      number for mapping.
      
      Non-contigous dma buffers are described using SG table and SG lists. Each
      valid SG List is pointing to a single page or group of pages which are
      physically contigous. Current implementation just maps the first page of each
      SG List and leave the other pages unmapped, leading to a crash. Given solution
      finds the page struct for the faulting page through parsing SG table and map it.
      Signed-off-by: NRahul Sharma <rahul.sharma@samsung.com>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      4ddc404b
    • I
      drm/exynos: remove EXYNOS_BO_NONCONTIG type checking. · ea6d66c3
      Inki Dae 提交于
      With iommu support, non-continuous buffer also is supported so
      this patch removes these checking from exynos_drm_gem_get/put_dma_addr
      funciton.
      
      This patch is based on the below patch set, "drm/exynos: add
      iommu support for -next".
      	http://www.spinics.net/lists/dri-devel/msg29041.htmlSigned-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      ea6d66c3
    • I
      drm/exynos: add iommu support for g2d · d87342c1
      Inki Dae 提交于
      Chagelog v2:
      removed unnecessary structure, struct g2d_gem_node.
      
      Chagelog v1:
      This patch adds iommu support for g2d driver. For this, it
      adds subdrv_probe/remove callback to enable or disable
      g2d iommu. And with this patch, in case of using g2d iommu,
      we can get or put device address to a gem handle from user
      through exynos_drm_gem_get/put_dma_addr(). Actually, these
      functions take a reference to a gem handle so that the gem
      object used by g2d dma is released properly.
      
      And runqueue_node has a pointer to drm_file object of current
      process to manage gem handles to owner.
      
      This patch is based on the below patch set, "drm/exynos: add
      iommu support for -next".
           http://www.spinics.net/lists/dri-devel/msg29041.htmlSigned-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      d87342c1
  6. 29 11月, 2012 1 次提交
    • I
      drm/exynos: add iommu support for exynos drm framework · 0519f9a1
      Inki Dae 提交于
      Changelog v4:
      - fix condition to drm_iommu_detach_device funtion.
      
      Changelog v3:
      - add dma_parms->max_segment_size setting of drm_device->dev.
      - use devm_kzalloc instead of kzalloc.
      
      Changelog v2:
      - fix iommu attach condition.
        . check archdata.dma_ops of drm device instead of
          subdrv device's one.
      - code clean to exynos_drm_iommu.c file.
        . remove '#ifdef CONFIG_ARM_DMA_USE_IOMMU' from exynos_drm_iommu.c
          and add it to driver/gpu/drm/exynos/Kconfig.
      
      Changelog v1:
      This patch adds iommu support for exynos drm framework with dma mapping
      api. In this patch, we used dma mapping api to allocate physical memory
      and maps it with iommu table and removed some existing codes and added
      new some codes for iommu support.
      
      GEM allocation requires one device object to use dma mapping api so
      this patch uses one iommu mapping for all sub drivers. In other words,
      all sub drivers have same iommu mapping.
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      0519f9a1
  7. 09 10月, 2012 1 次提交
    • K
      mm: kill vma flag VM_RESERVED and mm->reserved_vm counter · 314e51b9
      Konstantin Khlebnikov 提交于
      A long time ago, in v2.4, VM_RESERVED kept swapout process off VMA,
      currently it lost original meaning but still has some effects:
      
       | effect                 | alternative flags
      -+------------------------+---------------------------------------------
      1| account as reserved_vm | VM_IO
      2| skip in core dump      | VM_IO, VM_DONTDUMP
      3| do not merge or expand | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
      4| do not mlock           | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
      
      This patch removes reserved_vm counter from mm_struct.  Seems like nobody
      cares about it, it does not exported into userspace directly, it only
      reduces total_vm showed in proc.
      
      Thus VM_RESERVED can be replaced with VM_IO or pair VM_DONTEXPAND | VM_DONTDUMP.
      
      remap_pfn_range() and io_remap_pfn_range() set VM_IO|VM_DONTEXPAND|VM_DONTDUMP.
      remap_vmalloc_range() set VM_DONTEXPAND | VM_DONTDUMP.
      
      [akpm@linux-foundation.org: drivers/vfio/pci/vfio_pci.c fixup]
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Morris <james.l.morris@oracle.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
      Cc: Matt Helsley <matthltc@us.ibm.com>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Venkatesh Pallipadi <venki@google.com>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      314e51b9
  8. 03 10月, 2012 2 次提交
  9. 13 9月, 2012 2 次提交
  10. 27 7月, 2012 5 次提交
  11. 05 6月, 2012 1 次提交
  12. 08 5月, 2012 3 次提交
  13. 23 4月, 2012 3 次提交
  14. 21 4月, 2012 1 次提交
    • L
      VM: add "vm_mmap()" helper function · 6be5ceb0
      Linus Torvalds 提交于
      This continues the theme started with vm_brk() and vm_munmap():
      vm_mmap() does the same thing as do_mmap(), but additionally does the
      required VM locking.
      
      This uninlines (and rewrites it to be clearer) do_mmap(), which sadly
      duplicates it in mm/mmap.c and mm/nommu.c.  But that way we don't have
      to export our internal do_mmap_pgoff() function.
      
      Some day we hopefully don't have to export do_mmap() either, if all
      modular users can become the simpler vm_mmap() instead.  We're actually
      very close to that already, with the notable exception of the (broken)
      use in i810, and a couple of stragglers in binfmt_elf.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6be5ceb0
  15. 03 4月, 2012 1 次提交
  16. 20 3月, 2012 3 次提交
  17. 05 3月, 2012 1 次提交
  18. 29 12月, 2011 3 次提交
  19. 17 11月, 2011 1 次提交
  20. 15 11月, 2011 2 次提交
  21. 05 10月, 2011 1 次提交
    • I
      DRM: add DRM Driver for Samsung SoC EXYNOS4210. · 1c248b7d
      Inki Dae 提交于
      This patch is a DRM Driver for Samsung SoC Exynos4210 and now enables
      only FIMD yet but we will add HDMI support also in the future.
      
      this patch is based on git repository below:
      git://people.freedesktop.org/~airlied/linux.git
      branch name: drm-next
      commit-id: 88ef4e3f
      
      you can refer to our working repository below:
      http://git.infradead.org/users/kmpark/linux-2.6-samsung
      branch name: samsung-drm
      
      We tried to re-use lowlevel codes of the FIMD driver(s3c-fb.c
      based on Linux framebuffer) but couldn't so because lowlevel codes
      of s3c-fb.c are included internally and so FIMD module of this driver has
      its own lowlevel codes.
      
      We used GEM framework for buffer management and DMA APIs(dma_alloc_*)
      for buffer allocation so we can allocate physically continuous memory
      for DMA through it and also we could use CMA later if CMA is applied to
      mainline.
      
      Refer to this link for CMA(Continuous Memory Allocator):
      http://lkml.org/lkml/2011/7/20/45
      
      this driver supports only physically continuous memory(non-iommu).
      
      Links to previous versions of the patchset:
      v1: < https://lwn.net/Articles/454380/ >
      v2: < http://www.spinics.net/lists/kernel/msg1224275.html >
      v3: < http://www.spinics.net/lists/dri-devel/msg13755.html >
      v4: < http://permalink.gmane.org/gmane.comp.video.dri.devel/60439 >
      v5: < http://comments.gmane.org/gmane.comp.video.dri.devel/60802 >
      
      Changelog v2:
      DRM: add DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl command.
      
          this feature maps user address space to physical memory region
          once user application requests DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl.
      
      DRM: code clean and add exception codes.
      
      Changelog v3:
      DRM: Support multiple irq.
      
          FIMD and HDMI have their own irq handler but DRM Framework can regiter
          only one irq handler this patch supports mutiple irq for Samsung SoC.
      
      DRM: Consider modularization.
      
          each DRM, FIMD could be built as a module.
      
      DRM: Have indenpendent crtc object.
      
          crtc isn't specific to SoC Platform so this patch gets a crtc
          to be used as common object.
          created crtc could be attached to any encoder object.
      
      DRM: code clean and add exception codes.
      
      Changelog v4:
      DRM: remove is_defult from samsung_fb.
      
          is_default isn't used for default framebuffer.
      
      DRM: code refactoring to fimd module.
          this patch is be considered with multiple display objects and
          would use its own request_irq() to register a irq handler instead of
          drm framework's one.
      
      DRM: remove find_samsung_drm_gem_object()
      
      DRM: move kernel private data structures and definitions to driver folder.
      
          samsung_drm.h would contain only public information for userspace
          ioctl interface.
      
      DRM: code refactoring to gem modules.
          buffer module isn't dependent of gem module anymore.
      
      DRM: fixed security issue.
      
      DRM: remove encoder porinter from specific connector.
      
          samsung connector doesn't need to have generic encoder.
      
      DRM: code clean and add exception codes.
      
      Changelog v5:
      DRM: updated fimd(display controller) driver.
          added various pixel formats, color key and pixel blending features.
      
      DRM: removed end_buf_off from samsung_drm_overlay structure.
          this variable isn't used and end buffer address would be
          calculated by each sub driver.
      
      DRM: use generic function for mmap_offset.
          replaced samsung_drm_gem_create_mmap_offset() and
          samsung_drm_free_mmap_offset() with generic ones applied
          to mainline recentrly.
      
      DRM: removed unnecessary codes and added exception codes.
      
      DRM: added comments and code clean.
      
      Changelog v6:
      DRM: added default config options.
      
      DRM: added padding for 64-bit align.
      
      DRM: changed prefix 'samsung' to 'exynos'
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NJoonyoung Shim <jy0922.shim@samsung.com>
      Signed-off-by: NSeung-Woo Kim <sw0312.kim@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1c248b7d