mirror of https://gitee.com/openkylin/linux.git
drm/exynos/ipp: simplify property list allocation
prop_list is always allocated, so instead of allocating it dynamically the pointer can be replaced by the structure itself. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
This commit is contained in:
parent
f51bceec03
commit
3164605422
|
@ -1342,11 +1342,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
|
|||
|
||||
static int fimc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
|
||||
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
|
||||
if (!prop_list)
|
||||
return -ENOMEM;
|
||||
struct drm_exynos_ipp_prop_list *prop_list = &ippdrv->prop_list;
|
||||
|
||||
prop_list->version = 1;
|
||||
prop_list->writeback = 1;
|
||||
|
@ -1371,8 +1367,6 @@ static int fimc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
|||
prop_list->scale_min.hsize = FIMC_SCALE_MIN;
|
||||
prop_list->scale_min.vsize = FIMC_SCALE_MIN;
|
||||
|
||||
ippdrv->prop_list = prop_list;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1395,7 +1389,7 @@ static int fimc_ippdrv_check_property(struct device *dev,
|
|||
{
|
||||
struct fimc_context *ctx = get_fimc_context(dev);
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
struct drm_exynos_ipp_prop_list *pp = ippdrv->prop_list;
|
||||
struct drm_exynos_ipp_prop_list *pp = &ippdrv->prop_list;
|
||||
struct drm_exynos_ipp_config *config;
|
||||
struct drm_exynos_pos *pos;
|
||||
struct drm_exynos_sz *sz;
|
||||
|
|
|
@ -1335,11 +1335,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
|
|||
|
||||
static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
|
||||
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
|
||||
if (!prop_list)
|
||||
return -ENOMEM;
|
||||
struct drm_exynos_ipp_prop_list *prop_list = &ippdrv->prop_list;
|
||||
|
||||
prop_list->version = 1;
|
||||
prop_list->writeback = 1;
|
||||
|
@ -1363,8 +1359,6 @@ static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
|||
prop_list->scale_min.hsize = GSC_SCALE_MIN;
|
||||
prop_list->scale_min.vsize = GSC_SCALE_MIN;
|
||||
|
||||
ippdrv->prop_list = prop_list;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1387,7 +1381,7 @@ static int gsc_ippdrv_check_property(struct device *dev,
|
|||
{
|
||||
struct gsc_context *ctx = get_gsc_context(dev);
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
struct drm_exynos_ipp_prop_list *pp = ippdrv->prop_list;
|
||||
struct drm_exynos_ipp_prop_list *pp = &ippdrv->prop_list;
|
||||
struct drm_exynos_ipp_config *config;
|
||||
struct drm_exynos_pos *pos;
|
||||
struct drm_exynos_sz *sz;
|
||||
|
|
|
@ -346,7 +346,7 @@ int exynos_drm_ipp_get_property(struct drm_device *drm_dev, void *data,
|
|||
return PTR_ERR(ippdrv);
|
||||
}
|
||||
|
||||
*prop_list = *ippdrv->prop_list;
|
||||
*prop_list = ippdrv->prop_list;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1713,7 +1713,7 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
|||
DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]ipp_id[%d]\n",
|
||||
count++, (int)ippdrv, ipp_id);
|
||||
|
||||
ippdrv->prop_list->ipp_id = ipp_id;
|
||||
ippdrv->prop_list.ipp_id = ipp_id;
|
||||
|
||||
/* store parent device for node */
|
||||
ippdrv->parent_dev = dev;
|
||||
|
|
|
@ -165,7 +165,7 @@ struct exynos_drm_ippdrv {
|
|||
struct workqueue_struct *event_workq;
|
||||
struct drm_exynos_ipp_cmd_node *c_node;
|
||||
struct list_head cmd_list;
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
struct drm_exynos_ipp_prop_list prop_list;
|
||||
|
||||
int (*check_property)(struct device *dev,
|
||||
struct drm_exynos_ipp_property *property);
|
||||
|
|
|
@ -470,11 +470,7 @@ static struct exynos_drm_ipp_ops rot_dst_ops = {
|
|||
|
||||
static int rotator_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
|
||||
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
|
||||
if (!prop_list)
|
||||
return -ENOMEM;
|
||||
struct drm_exynos_ipp_prop_list *prop_list = &ippdrv->prop_list;
|
||||
|
||||
prop_list->version = 1;
|
||||
prop_list->flip = (1 << EXYNOS_DRM_FLIP_VERTICAL) |
|
||||
|
@ -487,8 +483,6 @@ static int rotator_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
|||
prop_list->crop = 0;
|
||||
prop_list->scale = 0;
|
||||
|
||||
ippdrv->prop_list = prop_list;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue