From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "moderated list:ARM/S5P EXYNOS AR..."
<linux-samsung-soc@vger.kernel.org>,
ML dri-devel <dri-devel@lists.freedesktop.org>,
Joonyoung Shim <jy0922.shim@samsung.com>,
gustavo.padovan@collabora.co.uk, Inki Dae <inki.dae@samsung.com>
Subject: Re: [PATCH 1/9] exynos: fimg2d: fix return codes
Date: Fri, 12 Jun 2015 18:21:13 +0200 [thread overview]
Message-ID: <557B06F9.9060400@math.uni-bielefeld.de> (raw)
In-Reply-To: <CACvgo50-A71yG1vtyyow_tEcAe4cUnpNfsbh8hAPYskju5AdxQ@mail.gmail.com>
Hello Emil,
Emil Velikov wrote:
> On 10 June 2015 at 14:42, Tobias Jakobi <tjakobi@math.uni-bielefeld.de> wrote:
>> Even if flushing the command buffer doesn't succeed, the
>> G2D calls would still return zero. Fix this by just passing
>> the flush return code.
>>
>> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>> ---
>> exynos/exynos_fimg2d.c | 20 +++++---------------
>> 1 file changed, 5 insertions(+), 15 deletions(-)
>>
>> diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
>> index 86ae898..5ea42e6 100644
>> --- a/exynos/exynos_fimg2d.c
>> +++ b/exynos/exynos_fimg2d.c
>> @@ -330,9 +330,7 @@ g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img,
>> bitblt.data.fast_solid_color_fill_en = 1;
>> g2d_add_cmd(ctx, BITBLT_COMMAND_REG, bitblt.val);
>>
>> - g2d_flush(ctx);
>> -
>> - return 0;
>> + return g2d_flush(ctx);
>> }
>>
>> /**
>> @@ -415,9 +413,7 @@ g2d_copy(struct g2d_context *ctx, struct g2d_image *src,
>> rop4.data.unmasked_rop3 = G2D_ROP3_SRC;
>> g2d_add_cmd(ctx, ROP4_REG, rop4.val);
>>
>> - g2d_flush(ctx);
>> -
>> - return 0;
>> + return g2d_flush(ctx);
>> }
>>
>> /**
>> @@ -527,9 +523,7 @@ g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src,
>> pt.data.y = dst_y + dst_h;
>> g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val);
>>
>> - g2d_flush(ctx);
>> -
>> - return 0;
>> + return g2d_flush(ctx);
>> }
>>
>> /**
>> @@ -636,9 +630,7 @@ g2d_blend(struct g2d_context *ctx, struct g2d_image *src,
>> pt.data.y = dst_y + h;
>> g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val);
>>
>> - g2d_flush(ctx);
>> -
>> - return 0;
>> + return g2d_flush(ctx);
>> }
>>
>> /**
>> @@ -766,7 +758,5 @@ g2d_scale_and_blend(struct g2d_context *ctx, struct g2d_image *src,
>> pt.data.y = dst_y + dst_h;
>> g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val);
>>
> Strictly speaking g2d_add_cmd() can fail, and all the functions that
> build upon it. In the latter case most ignore the return value which
> is a bit bad. That plus the fact that these are part of the public API
> makes things easier to misuse.
I'm totally aware of that. In fact I've already rewritten the error
checking logic. But that would be for a later series.
I prefer to do this in small steps, in particular because I see the
tendency that nobody from Samsung reviews the larger patches anyway. Or
any patches at all. And yes, I'm voicing my frustration here...
> One way to avoid all this is to implement an internal function that
> does the size checks ahead of time, and drop them from g2d_add_cmd(),
> apart from this patch.
I'm doing something different, which however results in more or less the
same thing.
>
> The nouveau mesa drivers do a similar thing - see PUSH_SPACE().
>
> -Emil
>
With best wishes,
Tobias
next prev parent reply other threads:[~2015-06-12 16:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 13:42 [PATCH 0/9] drm/exynos: cleanups and small fixes for libdrm Tobias Jakobi
2015-06-10 13:42 ` [PATCH 1/9] exynos: fimg2d: fix return codes Tobias Jakobi
2015-06-12 15:57 ` Emil Velikov
2015-06-12 16:21 ` Tobias Jakobi [this message]
2015-06-10 13:42 ` [PATCH 2/9] tests/exynos: replace return by break Tobias Jakobi
2015-06-10 13:42 ` [PATCH 3/9] exynos/fimg2d: simplify g2d_fini() Tobias Jakobi
2015-06-10 13:42 ` [PATCH 4/9] tests/exynos: clean struct connector Tobias Jakobi
2015-06-12 15:59 ` Emil Velikov
2015-06-12 16:22 ` Tobias Jakobi
2015-06-10 13:42 ` [PATCH 5/9] tests/exynos: remove unused define Tobias Jakobi
2015-06-10 13:42 ` [PATCH 6/9] tests/exynos: remove struct fimg2d_test_case Tobias Jakobi
2015-06-12 16:06 ` Emil Velikov
2015-06-12 16:25 ` Tobias Jakobi
2015-06-12 16:41 ` Emil Velikov
2015-06-10 13:42 ` [PATCH 7/9] tests/exynos: simplify drm_set_crtc Tobias Jakobi
2015-06-10 13:42 ` [PATCH 8/9] tests/exynos: remove connector_find_plane Tobias Jakobi
2015-06-12 16:01 ` Emil Velikov
2015-06-10 13:42 ` [PATCH 9/9] tests/exynos: handle G2D_IMGBUF_COLOR in switch statements Tobias Jakobi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=557B06F9.9060400@math.uni-bielefeld.de \
--to=tjakobi@math.uni-bielefeld.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=gustavo.padovan@collabora.co.uk \
--cc=inki.dae@samsung.com \
--cc=jy0922.shim@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.