search for: pin_count

Displaying 20 results from an estimated 54 matches for "pin_count".

2019 May 16
5
[PATCH 0/2] Add BO reservation to GEM VRAM pin/unpin/push_to_system
A kernel test bot reported a problem with the locktorture testcase that was triggered by the GEM VRAM helpers. ... [ 10.004734] RIP: 0010:ttm_bo_validate+0x41/0x141 [ttm] ... [ 10.015669] ? kvm_sched_clock_read+0x5/0xd [ 10.016157] ? get_lock_stats+0x11/0x3f [ 10.016607] drm_gem_vram_pin+0x77/0xa2 [drm_vram_helper] [ 10.017229]
2019 May 16
5
[PATCH 0/2] Add BO reservation to GEM VRAM pin/unpin/push_to_system
A kernel test bot reported a problem with the locktorture testcase that was triggered by the GEM VRAM helpers. ... [ 10.004734] RIP: 0010:ttm_bo_validate+0x41/0x141 [ttm] ... [ 10.015669] ? kvm_sched_clock_read+0x5/0xd [ 10.016157] ? get_lock_stats+0x11/0x3f [ 10.016607] drm_gem_vram_pin+0x77/0xa2 [drm_vram_helper] [ 10.017229]
2019 May 20
1
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...trying to get rid of the LRU removal right now we sooner or later should be able to remove ttmo_bo_reserve()/_unreserve() as well (or at least replace them with tiny ttm_bo_lock() wrappers. Christian. > -Daniel > >> Cheers, Daniel >> >>> + >>> + if (gbo->pin_count) { >>> + ++gbo->pin_count; >>> + return 0; >>> + } >>> + >>> + drm_gem_vram_placement(gbo, pl_flag); >>> + for (i = 0; i < gbo->placement.num_placement; ++i) >>> + gbo->placements[i].flags...
2019 May 20
5
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...here. Especially for a very simplified vram helper like this one I expect that's going to lead to less wtf moments by driver writers :-) Maybe we should also do a large-scale s/reserve/lock/ within ttm, to align more with what we now have in dma-buf. Cheers, Daniel > + > + if (gbo->pin_count) { > + ++gbo->pin_count; > + return 0; > + } > + > + drm_gem_vram_placement(gbo, pl_flag); > + for (i = 0; i < gbo->placement.num_placement; ++i) > + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; > + > + ret = ttm_bo_validate(&gbo->bo, &gbo-&...
2019 May 20
5
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...here. Especially for a very simplified vram helper like this one I expect that's going to lead to less wtf moments by driver writers :-) Maybe we should also do a large-scale s/reserve/lock/ within ttm, to align more with what we now have in dma-buf. Cheers, Daniel > + > + if (gbo->pin_count) { > + ++gbo->pin_count; > + return 0; > + } > + > + drm_gem_vram_placement(gbo, pl_flag); > + for (i = 0; i < gbo->placement.num_placement; ++i) > + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; > + > + ret = ttm_bo_validate(&gbo->bo, &gbo-&...
2019 May 16
0
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...d. Use drm_gem_vram_pin() if possible. + * + * Returns: + * 0 on success, or + * a negative error code otherwise. + */ +int drm_gem_vram_pin_reserved(struct drm_gem_vram_object *gbo, + unsigned long pl_flag) +{ + int i, ret; + struct ttm_operation_ctx ctx = { false, false }; + + if (gbo->pin_count) { + ++gbo->pin_count; + return 0; + } + + drm_gem_vram_placement(gbo, pl_flag); + for (i = 0; i < gbo->placement.num_placement; ++i) + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; + + ret = ttm_bo_validate(&gbo->bo, &gbo->placement, &ctx); + if (ret < 0) +...
2019 May 20
0
[PATCH 1/2] drm: Add drm_gem_vram_{pin/unpin}_reserved() and convert mgag200
...this an essentially remove ttm_bo_reserve as a wrapper around the linux/reservation.h functions. Not sure whether that aligns with Christian's plans. TODO.rst patch might be a good step to get that discussion started. -Daniel > > Cheers, Daniel > > > + > > + if (gbo->pin_count) { > > + ++gbo->pin_count; > > + return 0; > > + } > > + > > + drm_gem_vram_placement(gbo, pl_flag); > > + for (i = 0; i < gbo->placement.num_placement; ++i) > > + gbo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; > > + > > + ret...
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...o: the GEM VRAM object > + * > + * Returns: > + * 0 on success, or > + * a negative error code otherwise. > + */ > +int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) > +{ > + int i, ret; > + struct ttm_operation_ctx ctx = { false, false }; > + > + if (!gbo->pin_count) > + return 0; WARN_ON_ONCE() here? That should not happen ... > +/** > + * drm_gem_vram_push_to_system() - \ > + Unpins a GEM VRAM object and moves it to system memory > + * @gbo: the GEM VRAM object > + * > + * This operation only works if the caller holds the final pin o...
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...o: the GEM VRAM object > + * > + * Returns: > + * 0 on success, or > + * a negative error code otherwise. > + */ > +int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) > +{ > + int i, ret; > + struct ttm_operation_ctx ctx = { false, false }; > + > + if (!gbo->pin_count) > + return 0; WARN_ON_ONCE() here? That should not happen ... > +/** > + * drm_gem_vram_push_to_system() - \ > + Unpins a GEM VRAM object and moves it to system memory > + * @gbo: the GEM VRAM object > + * > + * This operation only works if the caller holds the final pin o...
2019 Apr 29
4
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...emory. The buffer object has to be pinned to %TTM_PL_VRAM. > + * > + * Returns: > + * The buffer object's offset in video memory on success, or > + * a negative error code otherwise. > + */ > +s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo) > +{ > + if (!gbo->pin_count) > + return (s64)-ENODEV; > + return gbo->bo.offset; > +} > +EXPORT_SYMBOL(drm_gem_vram_offset); > + > +/** > + * drm_gem_vram_pin() - Pins a GEM VRAM object in a region. > + * @gbo: the GEM VRAM object > + * @pl_flag: a bitmask of possible memory regions > + * &gt...
2019 Apr 29
4
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...emory. The buffer object has to be pinned to %TTM_PL_VRAM. > + * > + * Returns: > + * The buffer object's offset in video memory on success, or > + * a negative error code otherwise. > + */ > +s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo) > +{ > + if (!gbo->pin_count) > + return (s64)-ENODEV; > + return gbo->bo.offset; > +} > +EXPORT_SYMBOL(drm_gem_vram_offset); > + > +/** > + * drm_gem_vram_pin() - Pins a GEM VRAM object in a region. > + * @gbo: the GEM VRAM object > + * @pl_flag: a bitmask of possible memory regions > + * &gt...
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...s offset in the device's video + * memory. The buffer object has to be pinned to %TTM_PL_VRAM. + * + * Returns: + * The buffer object's offset in video memory on success, or + * a negative errno code otherwise. + */ +s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo) +{ + if (!gbo->pin_count) + return (s64)-ENODEV; + return gbo->bo.offset; +} +EXPORT_SYMBOL(drm_gem_vram_offset); + +/** + * drm_gem_vram_pin() - Pins a GEM VRAM object in a region. + * @gbo: the GEM VRAM object + * @pl_flag: a bitmask of possible memory regions + * + * Pinning a buffer object ensures that it is not ev...
2019 Apr 29
0
[PATCH v3 01/19] drm: Add |struct drm_gem_vram_object| and helpers
...s offset in the device's video + * memory. The buffer object has to be pinned to %TTM_PL_VRAM. + * + * Returns: + * The buffer object's offset in video memory on success, or + * a negative error code otherwise. + */ +s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo) +{ + if (!gbo->pin_count) + return (s64)-ENODEV; + return gbo->bo.offset; +} +EXPORT_SYMBOL(drm_gem_vram_offset); + +/** + * drm_gem_vram_pin() - Pins a GEM VRAM object in a region. + * @gbo: the GEM VRAM object + * @pl_flag: a bitmask of possible memory regions + * + * Pinning a buffer object ensures that it is not ev...
2019 Apr 09
0
[PATCH 12/15] drm/vboxvideo: Convert vboxvideo driver to |struct drm_gem_ttm_object|
...ace_size *sizes); > void vbox_fbdev_fini(struct vbox_private *vbox); > > -struct vbox_bo { > - struct ttm_buffer_object bo; > - struct ttm_placement placement; > - struct ttm_bo_kmap_obj kmap; > - struct drm_gem_object gem; > - struct ttm_place placements[3]; > - int pin_count; > -}; > - > -#define gem_to_vbox_bo(gobj) container_of((gobj), struct vbox_bo, gem) > - > -static inline struct vbox_bo *vbox_bo(struct ttm_buffer_object *bo) > -{ > - return container_of(bo, struct vbox_bo, bo); > -} > - > -#define to_vbox_obj(x) container_of(x, stru...
2019 Apr 29
21
[PATCH v3 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It further converts the respective drivers to the generic code. The shared code is basically the same
2019 May 06
0
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
Hi thanks for reviewing the patches. Am 06.05.19 um 14:31 schrieb Gerd Hoffmann: >> + --gbo->pin_count; >> + if (gbo->pin_count) >> + return 0; >> + >> + if (gbo->kmap.virtual) >> + ttm_bo_kunmap(&gbo->kmap); >> + >> + drm_gem_vram_placement(gbo, TTM_PL_FLAG_SYSTEM); >> + for (i = 0; i < gbo->placement.num_placement ; ++i) >>...
2019 May 06
25
[PATCH v4 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It further converts the respective drivers to the generic code. The shared code is basically the same
2019 May 06
25
[PATCH v4 00/19] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It further converts the respective drivers to the generic code. The shared code is basically the same
2019 Apr 24
21
[PATCH v2 00/17] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It further converts the respective drivers to the generic code. The shared code is basically the same
2019 May 08
22
[PATCH v5 00/20] Share TTM code among DRM framebuffer drivers
Several simple framebuffer drivers copy most of the TTM code from each other. The implementation is always the same; except for the name of some data structures. As recently discussed, this patch set provides generic memory-management code for simple framebuffers with dedicated video memory. It further converts the respective drivers to the generic code. The shared code is basically the same