Message ID | 20230305221011.1404672-10-dmitry.osipenko@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers | expand |
Hi Am 05.03.23 um 23:10 schrieb Dmitry Osipenko: > Export drm_gem_un/pin() functions. They will be used by VirtIO-GPU driver > for pinning of an active framebuffer, preventing it from swapping out by > memory shrinker. Please see my reply to [10/11] on why this patch should not be used. Best regards Thomas > > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> > --- > drivers/gpu/drm/drm_gem.c | 2 ++ > drivers/gpu/drm/drm_internal.h | 2 -- > include/drm/drm_gem.h | 3 +++ > 3 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > index 3da34b121c93..6492c47b7142 100644 > --- a/drivers/gpu/drm/drm_gem.c > +++ b/drivers/gpu/drm/drm_gem.c > @@ -1153,12 +1153,14 @@ int drm_gem_pin(struct drm_gem_object *obj) > else > return 0; > } > +EXPORT_SYMBOL(drm_gem_pin); > > void drm_gem_unpin(struct drm_gem_object *obj) > { > if (obj->funcs->unpin) > obj->funcs->unpin(obj); > } > +EXPORT_SYMBOL(drm_gem_unpin); > > int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) > { > diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h > index d7e023bbb0d5..55d0ee7475f7 100644 > --- a/drivers/gpu/drm/drm_internal.h > +++ b/drivers/gpu/drm/drm_internal.h > @@ -173,8 +173,6 @@ void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); > void drm_gem_print_info(struct drm_printer *p, unsigned int indent, > const struct drm_gem_object *obj); > > -int drm_gem_pin(struct drm_gem_object *obj); > -void drm_gem_unpin(struct drm_gem_object *obj); > int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map); > void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map); > > diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h > index 7bd8e2bbbb36..f7703cb66569 100644 > --- a/include/drm/drm_gem.h > +++ b/include/drm/drm_gem.h > @@ -493,4 +493,7 @@ unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, > > int drm_gem_evict(struct drm_gem_object *obj); > > +int drm_gem_pin(struct drm_gem_object *obj); > +void drm_gem_unpin(struct drm_gem_object *obj); > + > #endif /* __DRM_GEM_H__ */
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 3da34b121c93..6492c47b7142 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -1153,12 +1153,14 @@ int drm_gem_pin(struct drm_gem_object *obj) else return 0; } +EXPORT_SYMBOL(drm_gem_pin); void drm_gem_unpin(struct drm_gem_object *obj) { if (obj->funcs->unpin) obj->funcs->unpin(obj); } +EXPORT_SYMBOL(drm_gem_unpin); int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) { diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index d7e023bbb0d5..55d0ee7475f7 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -173,8 +173,6 @@ void drm_gem_release(struct drm_device *dev, struct drm_file *file_private); void drm_gem_print_info(struct drm_printer *p, unsigned int indent, const struct drm_gem_object *obj); -int drm_gem_pin(struct drm_gem_object *obj); -void drm_gem_unpin(struct drm_gem_object *obj); int drm_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map); void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map); diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 7bd8e2bbbb36..f7703cb66569 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -493,4 +493,7 @@ unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, int drm_gem_evict(struct drm_gem_object *obj); +int drm_gem_pin(struct drm_gem_object *obj); +void drm_gem_unpin(struct drm_gem_object *obj); + #endif /* __DRM_GEM_H__ */
Export drm_gem_un/pin() functions. They will be used by VirtIO-GPU driver for pinning of an active framebuffer, preventing it from swapping out by memory shrinker. Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> --- drivers/gpu/drm/drm_gem.c | 2 ++ drivers/gpu/drm/drm_internal.h | 2 -- include/drm/drm_gem.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-)