Lima DRM driver
Subsystems (3)
Qiang Yu
maintainerv2 cover Lima DRM driver
Kernel DRM driver for ARM Mali 400/450 GPUs.
This patch serial is based on 5.0-rc7 with Rob Herring's recent drm_gem_object change:
https://patchwork.kernel.org/cover/10794421/
All lima commits are squashed. For whole history of this driver's development, see:
https://gitlab.freedesktop.org/lima/linux/commits/lima-5.0-rc7
https://gitlab.freedesktop.org/lima/linux/commits/lima-5.0-rc6
https://gitlab.freedesktop.org/lima/linux/commits/lima-5.0-rc5
https://gitlab.freedesktop.org/lima/linux/commits/lima-4.17-rc4
Mesa driver is still in development and not ready for daily usage, but can run some simple tests like kmscube and glamrk2, and some single full screen application like kodi-gbm, see:
https://gitlab.freedesktop.org/lima/mesa
[v1]
https://lists.freedesktop.org/archives/dri-devel/2019-February/206260.html
[rfc]
https://lists.freedesktop.org/archives/dri-devel/2018-May/177314.html
Qiang Yu (2):
drm: export drm_timeout_abs_to_jiffies
drm/lima: driver for ARM Mali4xx GPUs
drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_syncobj.c | 3 +- drivers/gpu/drm/lima/Kconfig | 9 + drivers/gpu/drm/lima/Makefile | 21 ++ drivers/gpu/drm/lima/lima_bcast.c | 46 +++ drivers/gpu/drm/lima/lima_bcast.h | 14 + drivers/gpu/drm/lima/lima_ctx.c | 105 +++++++ drivers/gpu/drm/lima/lima_ctx.h | 30 ++ drivers/gpu/drm/lima/lima_device.c | 376 +++++++++++++++++++++++ drivers/gpu/drm/lima/lima_device.h | 129 ++++++++ drivers/gpu/drm/lima/lima_dlbu.c | 56 ++++ drivers/gpu/drm/lima/lima_dlbu.h | 18 ++ drivers/gpu/drm/lima/lima_drv.c | 353 +++++++++++++++++++++ drivers/gpu/drm/lima/lima_drv.h | 46 +++ drivers/gpu/drm/lima/lima_gem.c | 379 +++++++++++++++++++++++ drivers/gpu/drm/lima/lima_gem.h | 25 ++ drivers/gpu/drm/lima/lima_gem_prime.c | 47 +++ drivers/gpu/drm/lima/lima_gem_prime.h | 13 + drivers/gpu/drm/lima/lima_gp.c | 282 +++++++++++++++++ drivers/gpu/drm/lima/lima_gp.h | 16 + drivers/gpu/drm/lima/lima_l2_cache.c | 80 +++++ drivers/gpu/drm/lima/lima_l2_cache.h | 14 + drivers/gpu/drm/lima/lima_mmu.c | 142 +++++++++ drivers/gpu/drm/lima/lima_mmu.h | 16 + drivers/gpu/drm/lima/lima_object.c | 128 ++++++++ drivers/gpu/drm/lima/lima_object.h | 36 +++ drivers/gpu/drm/lima/lima_pmu.c | 59 ++++ drivers/gpu/drm/lima/lima_pmu.h | 12 + drivers/gpu/drm/lima/lima_pp.c | 423 ++++++++++++++++++++++++++ drivers/gpu/drm/lima/lima_pp.h | 19 ++ drivers/gpu/drm/lima/lima_regs.h | 298 ++++++++++++++++++ drivers/gpu/drm/lima/lima_sched.c | 403 ++++++++++++++++++++++++ drivers/gpu/drm/lima/lima_sched.h | 104 +++++++ drivers/gpu/drm/lima/lima_vm.c | 280 +++++++++++++++++ drivers/gpu/drm/lima/lima_vm.h | 62 ++++ include/drm/drm_utils.h | 4 + include/uapi/drm/lima_drm.h | 126 ++++++++ 38 files changed, 4176 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/lima/Kconfig create mode 100644 drivers/gpu/drm/lima/Makefile create mode 100644 drivers/gpu/drm/lima/lima_bcast.c create mode 100644 drivers/gpu/drm/lima/lima_bcast.h create mode 100644 drivers/gpu/drm/lima/lima_ctx.c create mode 100644 drivers/gpu/drm/lima/lima_ctx.h create mode 100644 drivers/gpu/drm/lima/lima_device.c create mode 100644 drivers/gpu/drm/lima/lima_device.h create mode 100644 drivers/gpu/drm/lima/lima_dlbu.c create mode 100644 drivers/gpu/drm/lima/lima_dlbu.h create mode 100644 drivers/gpu/drm/lima/lima_drv.c create mode 100644 drivers/gpu/drm/lima/lima_drv.h create mode 100644 drivers/gpu/drm/lima/lima_gem.c create mode 100644 drivers/gpu/drm/lima/lima_gem.h create mode 100644 drivers/gpu/drm/lima/lima_gem_prime.c create mode 100644 drivers/gpu/drm/lima/lima_gem_prime.h create mode 100644 drivers/gpu/drm/lima/lima_gp.c create mode 100644 drivers/gpu/drm/lima/lima_gp.h create mode 100644 drivers/gpu/drm/lima/lima_l2_cache.c create mode 100644 drivers/gpu/drm/lima/lima_l2_cache.h create mode 100644 drivers/gpu/drm/lima/lima_mmu.c create mode 100644 drivers/gpu/drm/lima/lima_mmu.h create mode 100644 drivers/gpu/drm/lima/lima_object.c create mode 100644 drivers/gpu/drm/lima/lima_object.h create mode 100644 drivers/gpu/drm/lima/lima_pmu.c create mode 100644 drivers/gpu/drm/lima/lima_pmu.h create mode 100644 drivers/gpu/drm/lima/lima_pp.c create mode 100644 drivers/gpu/drm/lima/lima_pp.h create mode 100644 drivers/gpu/drm/lima/lima_regs.h create mode 100644 drivers/gpu/drm/lima/lima_sched.c create mode 100644 drivers/gpu/drm/lima/lima_sched.h create mode 100644 drivers/gpu/drm/lima/lima_vm.c create mode 100644 drivers/gpu/drm/lima/lima_vm.h create mode 100644 include/uapi/drm/lima_drm.h
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Qiang Yu
maintainerPATCH v2 1/2 drm: export drm_timeout_abs_to_jiffies
For other driver like lima usage.
--- drivers/gpu/drm/drm_syncobj.c | 3 ++- include/drm/drm_utils.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_syncobj.c +2 -1
@@ -762,7 +762,7 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,* * Calculate the timeout in jiffies from an absolute time in sec/nsec. */ -static signed long drm_timeout_abs_to_jiffies (int64_t timeout_nsec) +signed long drm_timeout_abs_to_jiffies (int64_t timeout_nsec) {ktime_t abs_timeout, now;u64 timeout_ns, timeout_jiffies64;
@@ -786,6 +786,7 @@ static signed long drm_timeout_abs_to_jiffies(int64_t timeout_nsec)return timeout_jiffies64 +1 ; } +EXPORT_SYMBOL (drm_timeout_abs_to_jiffies); static int drm_syncobj_array_wait(struct drm_device *dev, struct drm_file *file_private,
include/drm/drm_utils.h +4 -0
@@ -10,6 +10,10 @@#ifndef __DRM_UTILS_H__#define __DRM_UTILS_H__ +#include <linux/types.h> +int drm_get_panel_orientation_quirk (int width,int height); +signed long drm_timeout_abs_to_jiffies (int64_t timeout_nsec); +#endif
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 1/2] drm: export drm_timeout_abs_to_jiffies
Quoted 9 lines · Qiang Yu
For other driver like lima usage.
Cc Rob Herring <[email protected]>Signed-off-by Qiang Yu <[email protected]>--- drivers/gpu/drm/drm_syncobj.c | 3 ++- include/drm/drm_utils.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
I've applied this one.
Rob
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Qiang Yu
maintainerPATCH v2 2/2 drm/lima: driver for ARM Mali4xx GPUs
In reply to Qiang Yu- Mali 4xx GPUs have two kinds of processors GP and PP. GP is for OpenGL vertex shader processing and PP is for fragment shader processing. Each processor has its own MMU so prcessors work in virtual address space.
- There's only one GP but multiple PP (max 4 for mali 400 and 8 for mali 450) in the same mali 4xx GPU. All PPs are grouped togather to handle a single fragment shader task divided by FB output tiled pixels. Mali 400 user space driver is responsible for assign target tiled pixels to each PP, but mali 450 has a HW module called DLBU to dynamically balance each PP's load.
- User space driver allocate buffer object and map into GPU virtual address space, upload command stream and draw data with CPU mmap of the buffer object, then submit task to GP/PP with a register frame indicating where is the command stream and misc settings.
- There's no command stream validation/relocation due to each user process has its own GPU virtual address space. GP/PP's MMU switch virtual address space before running two tasks from different user process. Error or evil user space code just get MMU fault or GP/PP error IRQ, then the HW/SW will be recovered.
- Use GEM+shmem for MM. Currently just alloc and pin memory when gem object creation. GPU vm map of the buffer is also done in the alloc stage in kernel space. We may delay the memory allocation and real GPU vm map to command submition stage in the furture as improvement.
- Use drm_sched for GPU task schedule. Each OpenGL context should have a lima context object in the kernel to distinguish tasks from different user. drm_sched gets task from each lima context in a fair way.
v2:
- fix syscall argument check
- fix job finish fence leak since kernel 5.0
- use drm syncobj to replace native fence
- move buffer object GPU va map into kernel
- reserve syscall argument space for future info
- remove kernel gem modifier
- switch TTM back to GEM+shmem MM
- use time based io poll
- use whole register name
- adopt gem reservation obj integration
- use drm_timeout_abs_to_jiffies
--- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/lima/Kconfig | 9 + drivers/gpu/drm/lima/Makefile | 21 ++ drivers/gpu/drm/lima/lima_bcast.c | 46 +++ drivers/gpu/drm/lima/lima_bcast.h | 14 + drivers/gpu/drm/lima/lima_ctx.c | 105 +++++++ drivers/gpu/drm/lima/lima_ctx.h | 30 ++ drivers/gpu/drm/lima/lima_device.c | 376 +++++++++++++++++++++++ drivers/gpu/drm/lima/lima_device.h | 129 ++++++++ drivers/gpu/drm/lima/lima_dlbu.c | 56 ++++ drivers/gpu/drm/lima/lima_dlbu.h | 18 ++ drivers/gpu/drm/lima/lima_drv.c | 353 +++++++++++++++++++++ drivers/gpu/drm/lima/lima_drv.h | 46 +++ drivers/gpu/drm/lima/lima_gem.c | 379 +++++++++++++++++++++++ drivers/gpu/drm/lima/lima_gem.h | 25 ++ drivers/gpu/drm/lima/lima_gem_prime.c | 47 +++ drivers/gpu/drm/lima/lima_gem_prime.h | 13 + drivers/gpu/drm/lima/lima_gp.c | 282 +++++++++++++++++ drivers/gpu/drm/lima/lima_gp.h | 16 + drivers/gpu/drm/lima/lima_l2_cache.c | 80 +++++ drivers/gpu/drm/lima/lima_l2_cache.h | 14 + drivers/gpu/drm/lima/lima_mmu.c | 142 +++++++++ drivers/gpu/drm/lima/lima_mmu.h | 16 + drivers/gpu/drm/lima/lima_object.c | 128 ++++++++ drivers/gpu/drm/lima/lima_object.h | 36 +++ drivers/gpu/drm/lima/lima_pmu.c | 59 ++++ drivers/gpu/drm/lima/lima_pmu.h | 12 + drivers/gpu/drm/lima/lima_pp.c | 423 ++++++++++++++++++++++++++ drivers/gpu/drm/lima/lima_pp.h | 19 ++ drivers/gpu/drm/lima/lima_regs.h | 298 ++++++++++++++++++ drivers/gpu/drm/lima/lima_sched.c | 403 ++++++++++++++++++++++++ drivers/gpu/drm/lima/lima_sched.h | 104 +++++++ drivers/gpu/drm/lima/lima_vm.c | 280 +++++++++++++++++ drivers/gpu/drm/lima/lima_vm.h | 62 ++++ include/uapi/drm/lima_drm.h | 126 ++++++++ 36 files changed, 4170 insertions(+) create mode 100644 drivers/gpu/drm/lima/Kconfig create mode 100644 drivers/gpu/drm/lima/Makefile create mode 100644 drivers/gpu/drm/lima/lima_bcast.c create mode 100644 drivers/gpu/drm/lima/lima_bcast.h create mode 100644 drivers/gpu/drm/lima/lima_ctx.c create mode 100644 drivers/gpu/drm/lima/lima_ctx.h create mode 100644 drivers/gpu/drm/lima/lima_device.c create mode 100644 drivers/gpu/drm/lima/lima_device.h create mode 100644 drivers/gpu/drm/lima/lima_dlbu.c create mode 100644 drivers/gpu/drm/lima/lima_dlbu.h create mode 100644 drivers/gpu/drm/lima/lima_drv.c create mode 100644 drivers/gpu/drm/lima/lima_drv.h create mode 100644 drivers/gpu/drm/lima/lima_gem.c create mode 100644 drivers/gpu/drm/lima/lima_gem.h create mode 100644 drivers/gpu/drm/lima/lima_gem_prime.c create mode 100644 drivers/gpu/drm/lima/lima_gem_prime.h create mode 100644 drivers/gpu/drm/lima/lima_gp.c create mode 100644 drivers/gpu/drm/lima/lima_gp.h create mode 100644 drivers/gpu/drm/lima/lima_l2_cache.c create mode 100644 drivers/gpu/drm/lima/lima_l2_cache.h create mode 100644 drivers/gpu/drm/lima/lima_mmu.c create mode 100644 drivers/gpu/drm/lima/lima_mmu.h create mode 100644 drivers/gpu/drm/lima/lima_object.c create mode 100644 drivers/gpu/drm/lima/lima_object.h create mode 100644 drivers/gpu/drm/lima/lima_pmu.c create mode 100644 drivers/gpu/drm/lima/lima_pmu.h create mode 100644 drivers/gpu/drm/lima/lima_pp.c create mode 100644 drivers/gpu/drm/lima/lima_pp.h create mode 100644 drivers/gpu/drm/lima/lima_regs.h create mode 100644 drivers/gpu/drm/lima/lima_sched.c create mode 100644 drivers/gpu/drm/lima/lima_sched.h create mode 100644 drivers/gpu/drm/lima/lima_vm.c create mode 100644 drivers/gpu/drm/lima/lima_vm.h create mode 100644 include/uapi/drm/lima_drm.h
drivers/gpu/drm/Kconfig +2 -0
@@ -333,6 +333,8 @@ source "drivers/gpu/drm/tve200/Kconfig" source "drivers/gpu/drm/xen/Kconfig" +source "drivers/gpu/drm/lima/Kconfig" + # Keep legacy drivers last menuconfig DRM_LEGACY
drivers/gpu/drm/Makefile +1 -0
@@ -109,3 +109,4 @@ obj-$(CONFIG_DRM_TINYDRM) += tinydrm/ obj-$(CONFIG_DRM_PL111) += pl111/ obj-$(CONFIG_DRM_TVE200) += tve200/ obj-$(CONFIG_DRM_XEN) += xen/ +obj-$(CONFIG_DRM_LIMA) += lima/
drivers/gpu/drm/lima/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 OR MIT +# Copyright 2017-2018 Qiang Yu <[email protected]> + +config DRM_LIMA + tristate "LIMA (DRM support for ARM Mali 400/450 GPU)" + depends on DRM + select DRM_SCHED + help + DRM driver for ARM Mali 400/450 GPUs.
drivers/gpu/drm/lima/Makefile new file +21 -0
@@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0 OR MIT +# Copyright 2017-2018 Qiang Yu <[email protected]> + +lima-y := \ + lima_drv.o \ + lima_device.o \ + lima_pmu.o \ + lima_l2_cache.o \ + lima_mmu.o \ + lima_gp.o \ + lima_pp.o \ + lima_gem.o \ + lima_vm.o \ + lima_sched.o \ + lima_ctx.o \ + lima_gem_prime.o \ + lima_dlbu.o \ + lima_bcast.o \ + lima_object.o + +obj-$(CONFIG_DRM_LIMA) += lima.o
drivers/gpu/drm/lima/lima_bcast.c new file +46 -0
46 lines not on this page · raw message
drivers/gpu/drm/lima/lima_bcast.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_BCAST_H__ +#define __LIMA_BCAST_H__ + +struct lima_ip ; + +int lima_bcast_init (struct lima_ip *ip); +void lima_bcast_fini (struct lima_ip *ip); + +void lima_bcast_enable (struct lima_device *dev,int num_pp); + +#endif
drivers/gpu/drm/lima/lima_ctx.c new file +105 -0
105 lines not on this page · raw message
drivers/gpu/drm/lima/lima_ctx.h new file +30 -0
@@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_CTX_H__ +#define __LIMA_CTX_H__ + +#include <linux/idr.h> + +#include "lima_device.h" + +struct lima_ctx { +struct kref refcnt; +struct lima_device *dev; +struct lima_sched_context context[lima_pipe_num]; +atomic_t guilty; +}; + +struct lima_ctx_mgr { +spinlock_t lock; +struct idr handles; +}; + +int lima_ctx_create (struct lima_device *dev,struct lima_ctx_mgr *mgr,u32 *id); +int lima_ctx_free (struct lima_ctx_mgr *mgr,u32 id); +struct lima_ctx *lima_ctx_get (struct lima_ctx_mgr *mgr,u32 id); +void lima_ctx_put (struct lima_ctx *ctx); +void lima_ctx_mgr_init (struct lima_ctx_mgr *mgr); +void lima_ctx_mgr_fini (struct lima_ctx_mgr *mgr); + +#endif
drivers/gpu/drm/lima/lima_device.c new file +376 -0
376 lines not on this page · raw message
drivers/gpu/drm/lima/lima_device.h new file +129 -0
129 lines not on this page · raw message
drivers/gpu/drm/lima/lima_dlbu.c new file +56 -0
56 lines not on this page · raw message
drivers/gpu/drm/lima/lima_dlbu.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_DLBU_H__ +#define __LIMA_DLBU_H__ + +struct lima_ip ; +struct lima_device ; + +void lima_dlbu_enable (struct lima_device *dev,int num_pp); +void lima_dlbu_disable (struct lima_device *dev); + +void lima_dlbu_set_reg (struct lima_ip *ip,u32 *reg); + +int lima_dlbu_init (struct lima_ip *ip); +void lima_dlbu_fini (struct lima_ip *ip); + +#endif
drivers/gpu/drm/lima/lima_drv.c new file +353 -0
353 lines not on this page · raw message
drivers/gpu/drm/lima/lima_drv.h new file +46 -0
46 lines not on this page · raw message
drivers/gpu/drm/lima/lima_gem.c new file +379 -0
379 lines not on this page · raw message
drivers/gpu/drm/lima/lima_gem.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2017-2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_GEM_H__ +#define __LIMA_GEM_H__ + +struct lima_bo ; +struct lima_submit ; + +extern const struct vm_operations_struct lima_gem_vm_ops; + +struct lima_bo *lima_gem_create_bo (struct drm_device *dev,u32 size,u32 flags); +int lima_gem_create_handle (struct drm_device *dev,struct drm_file *file, +u32 size,u32 flags,u32 *handle); +void lima_gem_free_object (struct drm_gem_object *obj); +int lima_gem_object_open (struct drm_gem_object *obj,struct drm_file *file); +void lima_gem_object_close (struct drm_gem_object *obj,struct drm_file *file); +int lima_gem_get_info (struct drm_file *file,u32 handle,u32 *va,u64 *offset); +int lima_gem_mmap (struct file *filp,struct vm_area_struct *vma); +int lima_gem_submit (struct drm_file *file,struct lima_submit *submit); +int lima_gem_wait (struct drm_file *file,u32 handle,u32 op,s64 timeout_ns); + +void lima_set_vma_flags (struct vm_area_struct *vma); + +#endif
drivers/gpu/drm/lima/lima_gem_prime.c new file +47 -0
47 lines not on this page · raw message
drivers/gpu/drm/lima/lima_gem_prime.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_GEM_PRIME_H__ +#define __LIMA_GEM_PRIME_H__ + +struct drm_gem_object *lima_gem_prime_import_sg_table ( +struct drm_device *dev,struct dma_buf_attachment *attach, +struct sg_table *sgt); +struct sg_table *lima_gem_prime_get_sg_table (struct drm_gem_object *obj); +int lima_gem_prime_mmap (struct drm_gem_object *obj,struct vm_area_struct *vma); + +#endif
drivers/gpu/drm/lima/lima_gp.c new file +282 -0
282 lines not on this page · raw message
drivers/gpu/drm/lima/lima_gp.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2017-2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_GP_H__ +#define __LIMA_GP_H__ + +struct lima_ip ; +struct lima_device ; + +int lima_gp_init (struct lima_ip *ip); +void lima_gp_fini (struct lima_ip *ip); + +int lima_gp_pipe_init (struct lima_device *dev); +void lima_gp_pipe_fini (struct lima_device *dev); + +#endif
drivers/gpu/drm/lima/lima_l2_cache.c new file +80 -0
80 lines not on this page · raw message
drivers/gpu/drm/lima/lima_l2_cache.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2017-2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_L2_CACHE_H__ +#define __LIMA_L2_CACHE_H__ + +struct lima_ip ; + +int lima_l2_cache_init (struct lima_ip *ip); +void lima_l2_cache_fini (struct lima_ip *ip); + +int lima_l2_cache_flush (struct lima_ip *ip); + +#endif
drivers/gpu/drm/lima/lima_mmu.c new file +142 -0
142 lines not on this page · raw message
drivers/gpu/drm/lima/lima_mmu.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2017-2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_MMU_H__ +#define __LIMA_MMU_H__ + +struct lima_ip ; +struct lima_vm ; + +int lima_mmu_init (struct lima_ip *ip); +void lima_mmu_fini (struct lima_ip *ip); + +void lima_mmu_switch_vm (struct lima_ip *ip,struct lima_vm *vm); +void lima_mmu_page_fault_resume (struct lima_ip *ip); + +#endif
drivers/gpu/drm/lima/lima_object.c new file +128 -0
128 lines not on this page · raw message
drivers/gpu/drm/lima/lima_object.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_OBJECT_H__ +#define __LIMA_OBJECT_H__ + +#include <drm/drm_gem.h> + +#include "lima_device.h" + +struct lima_bo { +struct drm_gem_object gem; + +struct page **pages; +dma_addr_t *pages_dma_addr; +struct sg_table *sgt; +void *vaddr; + +struct mutex lock; +struct list_head va; +}; + +static inline struct lima_bo * +to_lima_bo (struct drm_gem_object *obj) +{ + return container_of(obj, struct lima_bo, gem); +} + +struct lima_bo *lima_bo_create (struct lima_device *dev,u32 size, +u32 flags,struct sg_table *sgt, +struct reservation_object *resv); +void lima_bo_destroy (struct lima_bo *bo); +void *lima_bo_vmap (struct lima_bo *bo); +void lima_bo_vunmap (struct lima_bo *bo); + +#endif
drivers/gpu/drm/lima/lima_pmu.c new file +59 -0
59 lines not on this page · raw message
drivers/gpu/drm/lima/lima_pmu.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2017-2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_PMU_H__ +#define __LIMA_PMU_H__ + +struct lima_ip ; + +int lima_pmu_init (struct lima_ip *ip); +void lima_pmu_fini (struct lima_ip *ip); + +#endif
drivers/gpu/drm/lima/lima_pp.c new file +423 -0
423 lines not on this page · raw message
drivers/gpu/drm/lima/lima_pp.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* Copyright 2017-2018 Qiang Yu <[email protected]> */ + +#ifndef __LIMA_PP_H__ +#define __LIMA_PP_H__ + +struct lima_ip ; +struct lima_device ; + +int lima_pp_init (struct lima_ip *ip); +void lima_pp_fini (struct lima_ip *ip); + +int lima_pp_bcast_init (struct lima_ip *ip); +void lima_pp_bcast_fini (struct lima_ip *ip); + +int lima_pp_pipe_init (struct lima_device *dev); +void lima_pp_pipe_fini (struct lima_device *dev); + +#endif
drivers/gpu/drm/lima/lima_regs.h new file +298 -0
94 lines not on this page · raw message
drivers/gpu/drm/lima/lima_sched.c new file +403 -0
403 lines not on this page · raw message
drivers/gpu/drm/lima/lima_sched.h new file +104 -0
104 lines not on this page · raw message
drivers/gpu/drm/lima/lima_vm.c new file +280 -0
280 lines not on this page · raw message
drivers/gpu/drm/lima/lima_vm.h new file +62 -0
62 lines not on this page · raw message
include/uapi/drm/lima_drm.h new file +126 -0
126 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Part of the diff is not shown here. View the raw message.
kbuild test robot
build botRe: [PATCH v2 2/2] drm/lima: driver for ARM Mali4xx GPUs
Thank you for the patch! Yet something to improve:
Hi Qiang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.0-rc8 next-20190225]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Qiang-Yu/drm-export-drm_timeout_abs_to_jiffies/20190226-010350
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.2.0 make.cross ARCH=m68k
All error/warnings (new ones prefixed by >>):
In file included from drivers/gpu//drm/lima/lima_object.c:8:
drivers/gpu//drm/lima/lima_object.h:31:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
struct reservation_object *resv);
^~~~~~~~~~~~~~~~~~
drivers/gpu//drm/lima/lima_object.c: In function 'lima_bo_destroy':
>> drivers/gpu//drm/lima/lima_object.c:14:4: error: implicit declaration of function 'kfree'; did you mean 'vfree'? [-Werror=implicit-function-declaration]
kfree(bo->pages);
^~~~~
vfree
drivers/gpu//drm/lima/lima_object.c: At top level:
drivers/gpu//drm/lima/lima_object.c:42:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
struct reservation_object *resv)
^~~~~~~~~~~~~~~~~~
drivers/gpu//drm/lima/lima_object.c: In function 'lima_bo_create_struct':
>> drivers/gpu//drm/lima/lima_object.c:49:7: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration]
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
^~~~~~~
vzalloc
drivers/gpu//drm/lima/lima_object.c:49:5: warning: assignment to 'struct lima_bo *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
^
drivers/gpu//drm/lima/lima_object.c:55:10: error: 'struct drm_gem_object' has no member named 'resv'; did you mean 'dev'?
bo->gem.resv = resv;
^~~~
dev
drivers/gpu//drm/lima/lima_object.c: At top level:
drivers/gpu//drm/lima/lima_object.c:68:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
struct reservation_object *resv)
^~~~~~~~~~~~~~~~~~
drivers/gpu//drm/lima/lima_object.c:66:17: error: conflicting types for 'lima_bo_create'
struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
^~~~~~~~~~~~~~
In file included from drivers/gpu//drm/lima/lima_object.c:8:
drivers/gpu//drm/lima/lima_object.h:29:17: note: previous declaration of 'lima_bo_create' was here
struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
^~~~~~~~~~~~~~
drivers/gpu//drm/lima/lima_object.c: In function 'lima_bo_create':
drivers/gpu//drm/lima/lima_object.c:74:47: error: passing argument 4 of 'lima_bo_create_struct' from incompatible pointer type [-Werror=incompatible-pointer-types]
bo = lima_bo_create_struct(dev, size, flags, resv);
^~~~
drivers/gpu//drm/lima/lima_object.c:42:38: note: expected 'struct reservation_object *' but argument is of type 'struct reservation_object *'
struct reservation_object *resv)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>> drivers/gpu//drm/lima/lima_object.c:80:21: warning: assignment to 'dma_addr_t *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
bo->pages_dma_addr = kzalloc(npages * sizeof(dma_addr_t), GFP_KERNEL);
^
drivers/gpu//drm/lima/lima_object.c:89:13: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
bo->pages = kzalloc(npages * sizeof(*bo->pages), GFP_KERNEL);
^cc1: some warnings being treated as errors
vim +80 drivers/gpu//drm/lima/lima_object.c
7
> 8 #include "lima_object.h"
9
10 void lima_bo_destroy(struct lima_bo *bo)
11 {
12 if (bo->sgt) {
13 if (bo->pages)
> 14 kfree(bo->pages);
15
16 drm_prime_gem_destroy(&bo->gem, bo->sgt);
17 }
18 else {
19 if (bo->pages_dma_addr) {
20 int i, npages = bo->gem.size >> PAGE_SHIFT;
21
22 for (i = 0; i < npages; i++) {
23 if (bo->pages_dma_addr[i])
24 dma_unmap_page(bo->gem.dev->dev,
25 bo->pages_dma_addr[i],
26 PAGE_SIZE, DMA_BIDIRECTIONAL);
27 }
28 }
29
30 if (bo->pages)
31 drm_gem_put_pages(&bo->gem, bo->pages, true, true);
32 }
33
34 if (bo->pages_dma_addr)
35 kfree(bo->pages_dma_addr);
36
37 drm_gem_object_release(&bo->gem);
38 kfree(bo);
39 }
40
41 static struct lima_bo *lima_bo_create_struct(struct lima_device *dev, u32 size, u32 flags,
42 struct reservation_object *resv)
43 {
44 struct lima_bo *bo;
45 int err;
46
47 size = PAGE_ALIGN(size);
48
> 49 bo = kzalloc(sizeof(*bo), GFP_KERNEL);
50 if (!bo)
51 return ERR_PTR(-ENOMEM);
52
53 mutex_init(&bo->lock);
54 INIT_LIST_HEAD(&bo->va);
55 bo->gem.resv = resv;
56
57 err = drm_gem_object_init(dev->ddev, &bo->gem, size);
58 if (err) {
59 kfree(bo);
60 return ERR_PTR(err);
61 }
62
63 return bo;
64 }
65
66 struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
67 u32 flags, struct sg_table *sgt,
68 struct reservation_object *resv)
69 {
70 int i, err;
71 size_t npages;
72 struct lima_bo *bo, *ret;
73
> 74 bo = lima_bo_create_struct(dev, size, flags, resv);
75 if (IS_ERR(bo))
76 return bo;
77
78 npages = bo->gem.size >> PAGE_SHIFT;
79
> 80 bo->pages_dma_addr = kzalloc(npages * sizeof(dma_addr_t), GFP_KERNEL);---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH v2 2/2] drm/lima: driver for ARM Mali4xx GPUs
In reply to Qiang YuThank you for the patch! Yet something to improve:
Hi Qiang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.0-rc8 next-20190225]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Qiang-Yu/drm-export-drm_timeout_abs_to_jiffies/20190226-010350
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.2.0 make.cross ARCH=sparc64
All error/warnings (new ones prefixed by >>):
In file included from drivers/gpu/drm/lima/lima_object.c:8:
drivers/gpu/drm/lima/lima_object.h:31:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
struct reservation_object *resv);
^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/lima/lima_object.c: In function 'lima_bo_destroy':
>> drivers/gpu/drm/lima/lima_object.c:14:4: error: implicit declaration of function 'kfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
kfree(bo->pages);
^~~~~
kvfree
drivers/gpu/drm/lima/lima_object.c: At top level:
drivers/gpu/drm/lima/lima_object.c:42:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
struct reservation_object *resv)
^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/lima/lima_object.c: In function 'lima_bo_create_struct':
>> drivers/gpu/drm/lima/lima_object.c:49:7: error: implicit declaration of function 'kzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
^~~~~~~
kvzalloc
>> drivers/gpu/drm/lima/lima_object.c:49:5: warning: assignment to 'struct lima_bo *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
^
drivers/gpu/drm/lima/lima_object.c:55:10: error: 'struct drm_gem_object' has no member named 'resv'; did you mean 'dev'?
bo->gem.resv = resv;
^~~~
dev
drivers/gpu/drm/lima/lima_object.c: At top level:
drivers/gpu/drm/lima/lima_object.c:68:18: warning: 'struct reservation_object' declared inside parameter list will not be visible outside of this definition or declaration
struct reservation_object *resv)
^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/lima/lima_object.c:66:17: error: conflicting types for 'lima_bo_create'
struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
^~~~~~~~~~~~~~
In file included from drivers/gpu/drm/lima/lima_object.c:8:
drivers/gpu/drm/lima/lima_object.h:29:17: note: previous declaration of 'lima_bo_create' was here
struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
^~~~~~~~~~~~~~
drivers/gpu/drm/lima/lima_object.c: In function 'lima_bo_create':
drivers/gpu/drm/lima/lima_object.c:74:47: error: passing argument 4 of 'lima_bo_create_struct' from incompatible pointer type [-Werror=incompatible-pointer-types]
bo = lima_bo_create_struct(dev, size, flags, resv);
^~~~
drivers/gpu/drm/lima/lima_object.c:42:38: note: expected 'struct reservation_object *' but argument is of type 'struct reservation_object *'
struct reservation_object *resv)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>> drivers/gpu/drm/lima/lima_object.c:80:21: warning: assignment to 'dma_addr_t *' {aka 'long long unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
bo->pages_dma_addr = kzalloc(npages * sizeof(dma_addr_t), GFP_KERNEL);
^
>> drivers/gpu/drm/lima/lima_object.c:89:13: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
bo->pages = kzalloc(npages * sizeof(*bo->pages), GFP_KERNEL);
^cc1: some warnings being treated as errors
vim +14 drivers/gpu/drm/lima/lima_object.c
7
> 8 #include "lima_object.h"
9
10 void lima_bo_destroy(struct lima_bo *bo)
11 {
12 if (bo->sgt) {
13 if (bo->pages)
> 14 kfree(bo->pages);
15
16 drm_prime_gem_destroy(&bo->gem, bo->sgt);
17 }
18 else {
19 if (bo->pages_dma_addr) {
20 int i, npages = bo->gem.size >> PAGE_SHIFT;
21
22 for (i = 0; i < npages; i++) {
23 if (bo->pages_dma_addr[i])
24 dma_unmap_page(bo->gem.dev->dev,
25 bo->pages_dma_addr[i],
26 PAGE_SIZE, DMA_BIDIRECTIONAL);
27 }
28 }
29
30 if (bo->pages)
31 drm_gem_put_pages(&bo->gem, bo->pages, true, true);
32 }
33
34 if (bo->pages_dma_addr)
35 kfree(bo->pages_dma_addr);
36
37 drm_gem_object_release(&bo->gem);
38 kfree(bo);
39 }
40
41 static struct lima_bo *lima_bo_create_struct(struct lima_device *dev, u32 size, u32 flags,
> 42 struct reservation_object *resv)
43 {
44 struct lima_bo *bo;
45 int err;
46
47 size = PAGE_ALIGN(size);
48
> 49 bo = kzalloc(sizeof(*bo), GFP_KERNEL);
50 if (!bo)
51 return ERR_PTR(-ENOMEM);
52
53 mutex_init(&bo->lock);
54 INIT_LIST_HEAD(&bo->va);
55 bo->gem.resv = resv;
56
57 err = drm_gem_object_init(dev->ddev, &bo->gem, size);
58 if (err) {
59 kfree(bo);
60 return ERR_PTR(err);
61 }
62
63 return bo;
64 }
65
66 struct lima_bo *lima_bo_create(struct lima_device *dev, u32 size,
67 u32 flags, struct sg_table *sgt,
68 struct reservation_object *resv)
69 {
70 int i, err;
71 size_t npages;
72 struct lima_bo *bo, *ret;
73
> 74 bo = lima_bo_create_struct(dev, size, flags, resv);
75 if (IS_ERR(bo))
76 return bo;
77
78 npages = bo->gem.size >> PAGE_SHIFT;
79
> 80 bo->pages_dma_addr = kzalloc(npages * sizeof(dma_addr_t), GFP_KERNEL);
81 if (!bo->pages_dma_addr) {
82 ret = ERR_PTR(-ENOMEM);
83 goto err_out;
84 }
85
86 if (sgt) {
87 bo->sgt = sgt;
88
> 89 bo->pages = kzalloc(npages * sizeof(*bo->pages), GFP_KERNEL);---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build bot[PATCH] drm/lima: fix ifnullfree.cocci warnings
In reply to Qiang Yudrivers/gpu/drm/lima/lima_object.c:14:3-8: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_object.c:35:2-7: WARNING: NULL check before some freeing…
From: kbuild test robot <[email protected]>
drivers/gpu/drm/lima/lima_object.c:14:3-8: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_object.c:35:2-7: WARNING: NULL check before some freeing functions is not needed.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
---
Please take the patch only if it's a positive warning. Thanks!
lima_object.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/lima/lima_object.c +2 -4
@@ -10,8 +10,7 @@void lima_bo_destroy (struct lima_bo *bo) {if (bo->sgt) { -if (bo->pages) -kfree (bo->pages); +kfree (bo->pages);drm_prime_gem_destroy (&bo->gem, bo->sgt); }
@@ -31,8 +30,7 @@ void lima_bo_destroy(struct lima_bo *bo)drm_gem_put_pages (&bo->gem, bo->pages, true, true); } -if (bo->pages_dma_addr) -kfree (bo->pages_dma_addr); +kfree (bo->pages_dma_addr);drm_gem_object_release (&bo->gem);kfree (bo);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH v2 2/2] drm/lima: driver for ARM Mali4xx GPUs
In reply to Qiang YuThank you for the patch! Perhaps something to improve:
Hi Qiang,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.0-rc8 next-20190225]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
coccinelle warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/lima/lima_device.c:143:54-61: ERROR: PTR_ERR applied after initialization to constant on line 140 -- >> drivers/gpu/drm/lima/lima_object.c:14:3-8: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_object.c:35:2-7: WARNING: NULL check before some freeing functions is not needed. -- >> drivers/gpu/drm/lima/lima_sched.c:35:2-20: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_sched.c:146:2-7: WARNING: NULL check before some freeing functions is not needed. -- >> drivers/gpu/drm/lima/lima_sched.c:115:13-20: WARNING opportunity for kmemdup
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build bot[PATCH] drm/lima: fix ifnullfree.cocci warnings
In reply to Qiang Yudrivers/gpu/drm/lima/lima_sched.c:35:2-20: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_sched.c:146:2-7: WARNING: NULL check before some freeing…
From: kbuild test robot <[email protected]>
drivers/gpu/drm/lima/lima_sched.c:35:2-20: WARNING: NULL check before some freeing functions is not needed. drivers/gpu/drm/lima/lima_sched.c:146:2-7: WARNING: NULL check before some freeing functions is not needed.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
---
Please take the patch only if it's a positive warning. Thanks!
lima_sched.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/lima/lima_sched.c +2 -4
@@ -31,8 +31,7 @@ int lima_sched_slab_init(void)void lima_sched_slab_fini (void ) { -if (lima_fence_slab) -kmem_cache_destroy (lima_fence_slab); +kmem_cache_destroy (lima_fence_slab); }static inline struct lima_fence *to_lima_fence (struct dma_fence *fence)
@@ -142,8 +141,7 @@ void lima_sched_task_fini(struct lima_scdma_fence_put (task->dep[i]); } -if (task->dep) -kfree (task->dep); +kfree (task->dep);if (task->bos) {for (i =0 ; i < task->num_bos; i++)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build bot[PATCH] drm/lima: fix memdup.cocci warnings
In reply to Qiang Yudrivers/gpu/drm/lima/lima_sched.c:115:13-20: WARNING opportunity for kmemdup
From: kbuild test robot <[email protected]>
drivers/gpu/drm/lima/lima_sched.c:115:13-20: WARNING opportunity for kmemdup
Use kmemdup rather than duplicating its implementation
Generated by: scripts/coccinelle/api/memdup.cocci
---
Please take the patch only if it's a positive warning. Thanks!
lima_sched.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/lima/lima_sched.c +1 -2
@@ -112,10 +112,9 @@ int lima_sched_task_init(struct lima_sch {int err, i; - task->bos =kmalloc (sizeof (*bos) * num_bos,GFP_KERNEL ); + task->bos =kmemdup (bos,sizeof (*bos) * num_bos,GFP_KERNEL );if (!task->bos)return -ENOMEM ; -memcpy (task->bos, bos,sizeof (*bos) * num_bos);for (i =0 ; i < num_bos; i++)drm_gem_object_get (&bos[i]->gem);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel