[PATCH v2 08/15] exynos: introduce g2d_add_base_addr helper function
Emil Velikov
emil.l.velikov at gmail.com
Mon Feb 23 03:22:25 PST 2015
On 16/02/15 13:46, Tobias Jakobi wrote:
> In almost all functions the base address register is written, so it
> makes sense to have a helper function for this.
>
> Signed-off-by: Tobias Jakobi <tjakobi at math.uni-bielefeld.de>
> ---
> exynos/exynos_fimg2d.c | 87 +++++++++++++++++++-------------------------------
> 1 file changed, 33 insertions(+), 54 deletions(-)
>
> diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
> index b79081e..c08974a 100644
> --- a/exynos/exynos_fimg2d.c
> +++ b/exynos/exynos_fimg2d.c
> @@ -41,6 +41,11 @@
>
> #define MIN(a, b) ((a) < (b) ? (a) : (b))
>
> +enum g2d_base_addr_reg {
> + g2d_dst = 0,
> + g2d_src
> +};
> +
> static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst)
> {
> /* The G2D hw scaling factor is a normalized inverse of the scaling factor. *
> @@ -132,6 +137,25 @@ static int g2d_add_cmd(struct g2d_context *ctx, unsigned long cmd,
> }
>
> /*
> + * g2d_add_base_addr - helper function to set dst/src base address register.
> + *
> + * @ctx: a pointer to g2d_context structure.
> + * @img: a pointer to the dst/src g2d_image structure.
> + * @reg: the register that should be set.
> + */
> +static void g2d_add_base_addr(struct g2d_context *ctx, struct g2d_image *img,
> + enum g2d_base_addr_reg reg)
> +{
> + const unsigned long cmd = (reg == g2d_dst) ? DST_BASE_ADDR_REG : SRC_BASE_ADDR_REG;
> +
Can we wrap this to 80 columns please ?
-Emil
More information about the dri-devel
mailing list