Message ID | 20230119224052.2879106-1-robdclark@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/mediatek: Remove dependency on GEM DMA helper | expand |
Hi, Rob: Rob Clark <robdclark@gmail.com> 於 2023年1月20日 週五 上午6:40寫道: > > From: Rob Clark <robdclark@chromium.org> > > It appears that the dependency on the DMA helpers was only for > drm_gem_dma_vm_ops. Applied to mediatek-drm-next [1], thanks. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next Regards, Chun-Kuang. > > Signed-off-by: Rob Clark <robdclark@chromium.org> > --- > drivers/gpu/drm/mediatek/Kconfig | 1 - > drivers/gpu/drm/mediatek/mtk_drm_gem.c | 7 ++++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/Kconfig > index 369e495d0c3e..b451dee64d34 100644 > --- a/drivers/gpu/drm/mediatek/Kconfig > +++ b/drivers/gpu/drm/mediatek/Kconfig > @@ -7,7 +7,6 @@ config DRM_MEDIATEK > depends on HAVE_ARM_SMCCC > depends on OF > depends on MTK_MMSYS > - select DRM_GEM_DMA_HELPER > select DRM_KMS_HELPER > select DRM_MIPI_DSI > select DRM_PANEL > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c > index 47e96b0289f9..9b3d15d3a983 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c > @@ -16,13 +16,18 @@ > > static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma); > > +static const struct vm_operations_struct vm_ops = { > + .open = drm_gem_vm_open, > + .close = drm_gem_vm_close, > +}; > + > static const struct drm_gem_object_funcs mtk_drm_gem_object_funcs = { > .free = mtk_drm_gem_free_object, > .get_sg_table = mtk_gem_prime_get_sg_table, > .vmap = mtk_drm_gem_prime_vmap, > .vunmap = mtk_drm_gem_prime_vunmap, > .mmap = mtk_drm_gem_object_mmap, > - .vm_ops = &drm_gem_dma_vm_ops, > + .vm_ops = &vm_ops, > }; > > static struct mtk_drm_gem_obj *mtk_drm_gem_init(struct drm_device *dev, > -- > 2.38.1 >
Hi, On Thu, Jan 19, 2023 at 2:40 PM Rob Clark <robdclark@gmail.com> wrote: > > From: Rob Clark <robdclark@chromium.org> > > It appears that the dependency on the DMA helpers was only for > drm_gem_dma_vm_ops. > > Signed-off-by: Rob Clark <robdclark@chromium.org> > --- > drivers/gpu/drm/mediatek/Kconfig | 1 - > drivers/gpu/drm/mediatek/mtk_drm_gem.c | 7 ++++++- > 2 files changed, 6 insertions(+), 2 deletions(-) Drive-by comment: can you post a follow-up patch that also removes the "#include <drm/drm_gem_dma_helper.h>" from "mtk_drm_gem.c", assuming that still compiles? If it doesn't compile, that might be a bad sign that we missed something. ;-) -Doug
diff --git a/drivers/gpu/drm/mediatek/Kconfig b/drivers/gpu/drm/mediatek/Kconfig index 369e495d0c3e..b451dee64d34 100644 --- a/drivers/gpu/drm/mediatek/Kconfig +++ b/drivers/gpu/drm/mediatek/Kconfig @@ -7,7 +7,6 @@ config DRM_MEDIATEK depends on HAVE_ARM_SMCCC depends on OF depends on MTK_MMSYS - select DRM_GEM_DMA_HELPER select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 47e96b0289f9..9b3d15d3a983 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -16,13 +16,18 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma); +static const struct vm_operations_struct vm_ops = { + .open = drm_gem_vm_open, + .close = drm_gem_vm_close, +}; + static const struct drm_gem_object_funcs mtk_drm_gem_object_funcs = { .free = mtk_drm_gem_free_object, .get_sg_table = mtk_gem_prime_get_sg_table, .vmap = mtk_drm_gem_prime_vmap, .vunmap = mtk_drm_gem_prime_vunmap, .mmap = mtk_drm_gem_object_mmap, - .vm_ops = &drm_gem_dma_vm_ops, + .vm_ops = &vm_ops, }; static struct mtk_drm_gem_obj *mtk_drm_gem_init(struct drm_device *dev,