Commit 6e366c28 authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: avoid copy in mgr_fld_read/write

Avoid unnecessary copy in mgr_fld_read/write by taking a pointer to the
reg_resc and using that.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930103840.18970-3-tomi.valkeinen@ti.comReviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent a9c4fbd5
......@@ -365,17 +365,17 @@ static inline u32 dispc_read_reg(struct dispc_device *dispc, u16 idx)
static u32 mgr_fld_read(struct dispc_device *dispc, enum omap_channel channel,
enum mgr_reg_fields regfld)
{
const struct dispc_reg_field rfld = mgr_desc[channel].reg_desc[regfld];
const struct dispc_reg_field *rfld = &mgr_desc[channel].reg_desc[regfld];
return REG_GET(dispc, rfld.reg, rfld.high, rfld.low);
return REG_GET(dispc, rfld->reg, rfld->high, rfld->low);
}
static void mgr_fld_write(struct dispc_device *dispc, enum omap_channel channel,
enum mgr_reg_fields regfld, int val)
{
const struct dispc_reg_field rfld = mgr_desc[channel].reg_desc[regfld];
const struct dispc_reg_field *rfld = &mgr_desc[channel].reg_desc[regfld];
REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low);
REG_FLD_MOD(dispc, rfld->reg, val, rfld->high, rfld->low);
}
static int dispc_get_num_ovls(struct dispc_device *dispc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment