drm/loongson: use drm_gem_ttm_dumb_map_offset()

Replace the open-coded lsdc_dumb_map_offset() with the generic
drm_gem_ttm_dumb_map_offset() helper, which is functionally identical.
This removes unnecessary boilerplate and aligns with the DRM convention
for TTM-based drivers.

Signed-off-by: Amin GATTOUT <amin.gattout@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260308-master-v1-1-af32d71c8a1d@gmail.com
This commit is contained in:
Amin GATTOUT 2026-03-08 11:15:57 +01:00 committed by Thomas Zimmermann
parent 648fa9ca27
commit 81e1035e1b
3 changed files with 2 additions and 20 deletions

View File

@ -13,6 +13,7 @@
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_ttm.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_gem_ttm_helper.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_modeset_helper.h>
#include <drm/drm_print.h>
@ -45,7 +46,7 @@ static const struct drm_driver lsdc_drm_driver = {
.debugfs_init = lsdc_debugfs_init,
.dumb_create = lsdc_dumb_create,
.dumb_map_offset = lsdc_dumb_map_offset,
.dumb_map_offset = drm_gem_ttm_dumb_map_offset,
.gem_prime_import_sg_table = lsdc_prime_import_sg_table,
DRM_FBDEV_TTM_DRIVER_OPS,
};

View File

@ -234,21 +234,6 @@ int lsdc_dumb_create(struct drm_file *file, struct drm_device *ddev,
return 0;
}
int lsdc_dumb_map_offset(struct drm_file *filp, struct drm_device *ddev,
u32 handle, uint64_t *offset)
{
struct drm_gem_object *gobj;
gobj = drm_gem_object_lookup(filp, handle);
if (!gobj)
return -ENOENT;
*offset = drm_vma_node_offset_addr(&gobj->vma_node);
drm_gem_object_put(gobj);
return 0;
}
void lsdc_gem_init(struct drm_device *ddev)
{

View File

@ -14,10 +14,6 @@ lsdc_prime_import_sg_table(struct drm_device *ddev,
struct dma_buf_attachment *attach,
struct sg_table *sg);
int lsdc_dumb_map_offset(struct drm_file *file,
struct drm_device *dev,
u32 handle,
uint64_t *offset);
int lsdc_dumb_create(struct drm_file *file,
struct drm_device *ddev,