All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schake <stschake@gmail.com>
To: John Stultz <john.stultz@linaro.org>
Cc: Robert Foss <robert.foss@collabora.com>,
	Sean Paul <seanpaul@google.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [RFC][PATCH] libdrm: gralloc_handle.h: Fix build issue with Android
Date: Sat, 17 Mar 2018 20:33:13 +0100	[thread overview]
Message-ID: <CAOZHkRzRxxGKRLFZkWVAXxKGjP52dT-cUmHvs4P35RacLgfzLg@mail.gmail.com> (raw)
In-Reply-To: <1521236882-21120-1-git-send-email-john.stultz@linaro.org>

Hey John,

On Fri, Mar 16, 2018 at 10:48 PM, John Stultz <john.stultz@linaro.org> wrote:
> In trying to integrate the new gralloc_handle.h with the
> drm_hwcomposer, I started seeing the following compilation
> errors:
>
> In file included from external/drm_hwcomposer/platformdrmgeneric.cpp:28:
> external/libdrm/android/gralloc_handle.h:108:9: error: cannot initialize return object of type 'native_handle_t *' (aka 'native_handle *') with an lvalue of type 'struct gralloc_handle_t *'
>         return handle;
>                ^~~~~~
> 1 error generated.
>
> This seems to be due to the gralloc_handle_create() definition
> claiming to return a native_handle_t * type, rather then a
> gralloc_handle_t *, which is what the code actually returns.
>
> This function isn't actually used in the current drm_hwcomposer,
> so I'm not totally sure that this fix is correct (rather then
> returning the gralloc_handle_t's embadedded native_handle_t ptr).

This changed in 009634e49309 ("android: fix gralloc_handle_create() problems")
to make the return value from gralloc_handle_create opaque to its user.

Since the only one that would use gralloc_handle_create is the gralloc
implementation itself (and libdrm isn't one) and using getters/setters was
rejected (IIRC), I would think there is no reason to obscure the return type.
Since buffer_handle_t is native_handle_t* is gralloc_handle_t* it's also
correct. The alternative to changing the declaration here is returning
nhandle instead of handle.

Adding Rob Herring who authored 009634e49309.

Thanks,
Stefan
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-03-17 19:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 21:48 [RFC][PATCH] libdrm: gralloc_handle.h: Fix build issue with Android John Stultz
2018-03-17 19:33 ` Stefan Schake [this message]
2018-03-28 15:19   ` Rob Herring
2018-03-28 15:22     ` Rob Herring
2018-04-03  2:58       ` Chih-Wei Huang
2018-04-03  8:22         ` Robert Foss
2018-03-20  5:12 ` Robert Foss
  -- strict thread matches above, loose matches on Subject: below --
2018-03-06 20:28 John Stultz
2018-03-07 13:37 ` Robert Foss

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=CAOZHkRzRxxGKRLFZkWVAXxKGjP52dT-cUmHvs4P35RacLgfzLg@mail.gmail.com \
    --to=stschake@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john.stultz@linaro.org \
    --cc=robert.foss@collabora.com \
    --cc=seanpaul@google.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 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.