From: Dan Carpenter <dan.carpenter@oracle.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: robh@kernel.org, emma@anholt.net, tomeu.vizoso@collabora.com,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
steven.price@arm.com, lima@lists.freedesktop.org,
yuq825@gmail.com, daniel@ffwll.ch, gurchetansingh@chromium.org,
virtualization@lists.linux-foundation.org, olvaffe@gmail.com,
alyssa.rosenzweig@collabora.com
Subject: Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object
Date: Mon, 6 Dec 2021 13:42:33 +0300 [thread overview]
Message-ID: <20211206104233.GD1978@kadam> (raw)
In-Reply-To: <20211130095255.26710-1-tzimmermann@suse.de>
On Tue, Nov 30, 2021 at 10:52:55AM +0100, Thomas Zimmermann wrote:
> GEM helper libraries use struct drm_driver.gem_create_object to let
> drivers override GEM object allocation. On failure, the call returns
> NULL.
>
> Change the semantics to make the calls return a pointer-encoded error.
> This aligns the callback with its callers. Fixes the ingenic driver,
> which already returns an error pointer.
>
> Also update the callers to handle the involved types more strictly.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> There is an alternative patch at [1] that updates the value returned
> by ingenics' gem_create_object to NULL. Fixing the interface to return
> an errno code is more consistent with the rest of the GEM functions.
>
> [1] https://lore.kernel.org/dri-devel/20211118111522.GD1147@kili/
My fix was already applied and backported to -stable etc... Your
patch is not developed against a current tree so you broke it.
That's the tricky thing with changing the API because say people wrote
their code last week where returning NULL was correct. When they submit
their driver upstream, everything will merge and build but it will break
at runtime.
For now, it's only vc4_create_object() which is broken.
regards,
dan carpenter
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-12-06 10:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 9:52 [PATCH] drm: Return error codes from struct drm_driver.gem_create_object Thomas Zimmermann
2021-12-06 10:42 ` Dan Carpenter [this message]
2021-12-06 11:16 ` Thomas Zimmermann
2021-12-06 14:40 ` Dan Carpenter
2021-12-07 8:24 ` Thomas Zimmermann
2021-12-07 8:55 ` Dan Carpenter
2021-12-07 9:24 ` Thomas Zimmermann
2021-12-08 10:22 ` Thomas Zimmermann
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=20211206104233.GD1978@kadam \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=alyssa.rosenzweig@collabora.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emma@anholt.net \
--cc=gurchetansingh@chromium.org \
--cc=lima@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=olvaffe@gmail.com \
--cc=robh@kernel.org \
--cc=steven.price@arm.com \
--cc=tomeu.vizoso@collabora.com \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=yuq825@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox