On Mon, Jul 13, 2015 at 02:52:09PM +0100, Emil Velikov wrote:
Abeit quite unlikely to get hit by this bug here, let just fix it.
v2: Correct conditional (do not call ioctl(DRM_IOCTL_PRIME_HANDLE_TO_FD) when we already have the fd).
Cc: freedreno@lists.freedesktop.org Cc: Rob Clark robdclark@gmail.com Signed-off-by: Emil Velikov emil.l.velikov@gmail.com
freedreno/freedreno_bo.c | 6 +++--- freedreno/kgsl/kgsl_bo.c | 1 + freedreno/msm/msm_bo.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-)
I think there's another one in kgsl_pipe_destroy(). With that fixed, this is:
Reviewed-by: Thierry Reding treding@nvidia.com
There are also a couple more like this in omap_drm.c (I suspect Rob copied from that =) that we may want to fix at the same time (in the same patch or a separate one).
There's also a few places where an fd is compared to -1 directly, which should be okay, but might be worth making consistent. I can send a patch if you're not pedantic enough. =)
Thierry