mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
Two fixups
- Fix missing unlock issue in exynos_drm_g2d.c - Fix a build warning in exynos_drm_dma.c One cleanup - Replace atomic_t with refcount_t in exynos_drm_g2d.c -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEGaM000JtH4Vhbu4NZMZxZtnUbQkFAmEhNlsACgkQZMZxZtnU bQm0Pw//SBVQaUhyZpVENV+YuNlJl5k2QvpBJGbn4KfJE/ZS29XcHcVXt1lj1DPj YwGGeAtFNVU+Ysg+gVOT90zGJMccG82iFgJNT9eycerHFAmZRCRgg36bo9k2e0Fb 2VTxrvTSBt6bYfeF/Jrdm0/6chvVSD97/2ZNTFix96V8MFpmm7n8vEbj/pSUGmDt lqujRREdFDrvywhQrDXY3r6ZqPSBIkLMi35XjBxk7r1GRFdhk3k7aMO0fBZyvZPT KklR0orkX0p4C1Gf73RpJPKmL/9ORwq/PIrRb5fGjWMJo1T3SK7iiMnBvBzkRPp9 HQbrMMOgXsuu6GW3nI70HkKAm2cn0JE54E36vKLGwopvGX8gvJUmzDNyjJmlW70O /R68ovHfMry32r0Ji9zr1k7EFPacP+bsYDJZzSToFYUHFvmnayPi2YnOFFsdeK4s Zl/4GpXu2DgyCNdiItUP8HGgDFxkuP18+NX9uH+HOp5WM/icXwPOR1+Y2CVO87RR 5BPO3qaOVjEHz0imRFpqJfWcZ+F8SApwmy7O1UJhg3VCtnBuWJMeaQxurG1b5tZ5 BTWxBBiZ/ShYcd84EGmfMiSi1GN91zNTjJDez1tMnVbRaRDVMbHg3uK91KIqkDJ0 Jkz5PESy8Vio6Em66a5n1GXygQW8TdSzg7LDJrGTaG65LxaafZE= =Mpcq -----END PGP SIGNATURE----- Merge tag 'exynos-drm-next-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Two fixups - Fix missing unlock issue in exynos_drm_g2d.c - Fix a build warning in exynos_drm_dma.c One cleanup - Replace atomic_t with refcount_t in exynos_drm_g2d.c Signed-off-by: Dave Airlie <airlied@redhat.com> From: Inki Dae <inki.dae@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210821172825.54720-1-inki.dae@samsung.com
This commit is contained in:
commit
7d8eb20271
|
|
@ -115,6 +115,8 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,
|
|||
EXYNOS_DEV_ADDR_START, EXYNOS_DEV_ADDR_SIZE);
|
||||
else if (IS_ENABLED(CONFIG_IOMMU_DMA))
|
||||
mapping = iommu_get_domain_for_dev(priv->dma_dev);
|
||||
else
|
||||
mapping = ERR_PTR(-ENODEV);
|
||||
|
||||
if (IS_ERR(mapping))
|
||||
return PTR_ERR(mapping);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Authors: Joonyoung Shim <jy0922.shim@samsung.com>
|
||||
*/
|
||||
|
||||
#include <linux/refcount.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/component.h>
|
||||
#include <linux/delay.h>
|
||||
|
|
@ -208,7 +209,7 @@ struct g2d_cmdlist_userptr {
|
|||
struct page **pages;
|
||||
unsigned int npages;
|
||||
struct sg_table *sgt;
|
||||
atomic_t refcount;
|
||||
refcount_t refcount;
|
||||
bool in_pool;
|
||||
bool out_of_list;
|
||||
};
|
||||
|
|
@ -386,9 +387,9 @@ static void g2d_userptr_put_dma_addr(struct g2d_data *g2d,
|
|||
if (force)
|
||||
goto out;
|
||||
|
||||
atomic_dec(&g2d_userptr->refcount);
|
||||
refcount_dec(&g2d_userptr->refcount);
|
||||
|
||||
if (atomic_read(&g2d_userptr->refcount) > 0)
|
||||
if (refcount_read(&g2d_userptr->refcount) > 0)
|
||||
return;
|
||||
|
||||
if (g2d_userptr->in_pool)
|
||||
|
|
@ -436,7 +437,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d,
|
|||
* and different size.
|
||||
*/
|
||||
if (g2d_userptr->size == size) {
|
||||
atomic_inc(&g2d_userptr->refcount);
|
||||
refcount_inc(&g2d_userptr->refcount);
|
||||
*obj = g2d_userptr;
|
||||
|
||||
return &g2d_userptr->dma_addr;
|
||||
|
|
@ -461,7 +462,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct g2d_data *g2d,
|
|||
if (!g2d_userptr)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
atomic_set(&g2d_userptr->refcount, 1);
|
||||
refcount_set(&g2d_userptr->refcount, 1);
|
||||
g2d_userptr->size = size;
|
||||
|
||||
start = userptr & PAGE_MASK;
|
||||
|
|
@ -897,13 +898,14 @@ static void g2d_runqueue_worker(struct work_struct *work)
|
|||
ret = pm_runtime_resume_and_get(g2d->dev);
|
||||
if (ret < 0) {
|
||||
dev_err(g2d->dev, "failed to enable G2D device.\n");
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
g2d_dma_start(g2d, g2d->runqueue_node);
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
mutex_unlock(&g2d->runqueue_mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user