From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752092AbcEJWge (ORCPT ); Tue, 10 May 2016 18:36:34 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:36380 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbcEJWgd (ORCPT ); Tue, 10 May 2016 18:36:33 -0400 MIME-Version: 1.0 X-Originating-IP: [2a02:168:56b5:0:ac27:b86c:7764:9429] In-Reply-To: <20160510065934.GG27098@phenom.ffwll.local> References: <1462454674-2246-1-git-send-email-noralf@tronnes.org> <1462454674-2246-4-git-send-email-noralf@tronnes.org> <20160509144648.GA27098@phenom.ffwll.local> <8b885635-4df5-e902-a755-3f32cab75131@tronnes.org> <20160510065934.GG27098@phenom.ffwll.local> Date: Wed, 11 May 2016 00:36:32 +0200 X-Google-Sender-Auth: BtP5Id6ci40Zebghdidsxd5FIJk Message-ID: Subject: Re: [PATCH 3/4] drm: Add helper for simple display pipeline From: Daniel Vetter To: =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= , dri-devel , Thierry Reding , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 10, 2016 at 8:59 AM, Daniel Vetter wrote: >> if (ret) >> return ret; >> >> /* How to handle !visible, is it even possible? */ > > if (!visible) > return -EINVAL; > > You can't, so need to reject it. Ok, on further thought I think we need a bit more here. We not just need to make sure the plane is visible and not scaled or positioned, but also that the plane is only enabled iff the crtc is. So even before you call anything else you need to have this check: if (crtc_state->enable != !!plane_state->crtc) return -EINVAL; /* plane must match crtc enable state */ if (!crtc_state->enable) return 0; /* nothing to check when disabling or disabled already, calling check helpers and driver callbacks might only result in confusion in such a case. */ Then continue with the remaining check logic that you have already, with my coments in the earlier mail addressed. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch