diff mbox

drm_hwcomposer: fix check for valid fence fd for in fences

Message ID 20180213221111.27707-1-robh@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Rob Herring Feb. 13, 2018, 10:11 p.m. UTC
The check for a valid fence fd is inverted, so we're failing to pass
IN_FENCE_FD's to the kernel when we have a valid fence.

Reported-by: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drmdisplaycompositor.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Robert Foss Feb. 14, 2018, 1:32 p.m. UTC | #1
Hey Rob,

This looks good to me, feel free to add my r-b.
Reviewed-by: Robert Foss <robert.foss@collabora.com>


Rob.

On 02/13/2018 11:11 PM, Rob Herring wrote:
> The check for a valid fence fd is inverted, so we're failing to pass
> IN_FENCE_FD's to the kernel when we have a valid fence.
> 
> Reported-by: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   drmdisplaycompositor.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> index 3a20b31dec99..e556e8641d79 100644
> --- a/drmdisplaycompositor.cpp
> +++ b/drmdisplaycompositor.cpp
> @@ -589,7 +589,7 @@ int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
>         else
>           rotation |= DRM_MODE_ROTATE_0;
>   
> -      if (fence_fd < 0) {
> +      if (fence_fd >= 0) {
>           int prop_id = plane->in_fence_fd_property().id();
>           if (prop_id == 0) {
>                   ALOGE("Failed to get IN_FENCE_FD property id");
>
diff mbox

Patch

diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index 3a20b31dec99..e556e8641d79 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -589,7 +589,7 @@  int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
       else
         rotation |= DRM_MODE_ROTATE_0;
 
-      if (fence_fd < 0) {
+      if (fence_fd >= 0) {
         int prop_id = plane->in_fence_fd_property().id();
         if (prop_id == 0) {
                 ALOGE("Failed to get IN_FENCE_FD property id");