Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3633843ybi; Tue, 18 Jun 2019 04:10:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3oRnEihnsRDCyfKwK/6TjBj/l2OPRomrkr51cbZVDdSxapE6A7ByPc9EdTbW04U+hqbPX X-Received: by 2002:a63:1b26:: with SMTP id b38mr2199129pgb.257.1560856207825; Tue, 18 Jun 2019 04:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560856207; cv=none; d=google.com; s=arc-20160816; b=0Cucu4g/CkTbvBx73kKNFmI/8MwKFL8vPaLVazO49rXAE9+b+5hqC/P2fynVciKcuU Y4ZNQuMCOE+uGmmRERDGuS2g+bHuWPelLMxRgGvM9QKg6ohL3Oy2ns5FR1vplAwOvIHu bEXlFKPIP2qG9UmTX5hpdQfe1IZVr5cVW7iajD6N7iAGy12MyxqcK6v5avtGiPisdq3f PyifnFLsjzAsRnSZhomxOpSpHgxf368SWAsXzlsXpwRQPeJsNLtuazuK72UznXEwzLqT 9uVD+3d3H3rK9SXOeFgehN6FqMnyegGJtWAz5I7q9IJ6Ylc6J871JXB/iXn19Wa2x9n4 WBdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=Uk40UhexmdEkWRPW8aWJEctkTMOanHrquMubXf3T9Dw=; b=L8ZJjBXePFYB+9l9dwUhZ20IPis7bEQivBN24WWfZhqlMRp4A6bpLej4ZHatMTvNGq ufeXvyt60dzvI3/iiT91XsLywwsAk/EiNoCB6rQsAtkh43kgDzASNzCT8zEhhozZ1qVa t8m+F63acqJ5JgMAcpIdNBIb4MG+iSmEu9sxrsEjEHKVEX72vHwl0yz5fqyZ4G77qVr/ gin116wdC2eSaNq1IQ5WS/qG4eZJFMgZmlHbwtK5JUq8zSNCmUWa5zOzkuBVf9FxkeqE P2aL4/ALtISHQh+x7MiwZnQ7T0uJ5BYKXHoitJzsdqfO7ld6EfKbSAip62lDMx6QPAIj w1uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=jpinsjW0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21si8206075pln.192.2019.06.18.04.09.52; Tue, 18 Jun 2019 04:10:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=jpinsjW0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729607AbfFRLJZ (ORCPT + 99 others); Tue, 18 Jun 2019 07:09:25 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:34729 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729458AbfFRLJZ (ORCPT ); Tue, 18 Jun 2019 07:09:25 -0400 Received: by mail-ed1-f67.google.com with SMTP id s49so21185070edb.1 for ; Tue, 18 Jun 2019 04:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Uk40UhexmdEkWRPW8aWJEctkTMOanHrquMubXf3T9Dw=; b=jpinsjW0qcygBTIUeWTLASX3k+7oqGLP4M9Q+dpKl8sjJMw6G0cFj4V6ZjdHwPYk/P xWsD5MxoYxor/OVbE21kjxVSQGCBA539AxgenHOoaKCnxKKaDBqomzJXTlhQlJLtXz8Y tJmEA9ANcXu+8KVckS5IWixebtK/KxxX3oxmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Uk40UhexmdEkWRPW8aWJEctkTMOanHrquMubXf3T9Dw=; b=Drx+wJ4mz7lB0NuWfVO540DEpZqOLVz/dCMQIjSfLhDxfOh6uLeK5MHkBzKyzOP0C8 RaifmxunqrPG4rpn+zS5/VsO2GDElQ4Gmjt/1+IcpkSj0VfFoUqDv3sqeT/gL2w+uZ30 EDYD5RoIoRC2V1343ciP6oJ67x9SJhEl6Vde+I7nLrvdzDUsaib0VQLe+mnNvVr1dCnC 2raQfKP0rI/a16aT/WXpAkMBl0x2LzTNR3MM6osIydz6tiQk0zs+ECQs+soiSYudiyOm 8HlparPCH2/BwLG+4xzqE1NPpr0ExffkpdZjNT1sypL5AlqdGEVC6NXxj8V22Dh6kVoc 4PHg== X-Gm-Message-State: APjAAAXlkv2LgeP0mdsgxzcGkRulwURgrPJ0Oc8JJEIm22/NhpamP/Ky K3S46X5yGHaukqL/ltloIGyPSaQWvgM= X-Received: by 2002:a50:8825:: with SMTP id b34mr46675030edb.22.1560856163828; Tue, 18 Jun 2019 04:09:23 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id t15sm2157524ejj.25.2019.06.18.04.09.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 04:09:23 -0700 (PDT) Date: Tue, 18 Jun 2019 13:09:20 +0200 From: Daniel Vetter To: Simon Ser Cc: Rodrigo Siqueira , Brian Starkey , Liviu Dudau , Daniel Vetter , Haneen Mohammed , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V2 4/5] drm/vkms: Use index instead of 0 in possible crtc Message-ID: <20190618110920.GT12905@phenom.ffwll.local> Mail-Followup-To: Simon Ser , Rodrigo Siqueira , Brian Starkey , Liviu Dudau , Haneen Mohammed , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" References: <971da2ede86d11357e6822409bef23cb03869f83.1560820888.git.rodrigosiqueiramelo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 4.19.0-5-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 18, 2019 at 07:56:23AM +0000, Simon Ser wrote: > Interestingly, even with the previous code, possible_crtcs=1 was > exposed to userspace [1]. I think this is because of a safeguard in > drm_crtc_init_with_planes (drm_crtc.c:284) which sets the primary and > cursor plane's possible_crtcs to the first CRTC if zero. > > If we want to warn on possible_crtcs=0, we should probably remove this > safeguard. Checking first whether this safeguard is used by any driver > is probably a good idea. > > [1]: https://drmdb.emersion.fr/devices/f218d1242714 Yeaht it's a bit a mess, that's why I've suggested we should bite this bullet and fix it for real. There's a bunch others such bitmasks that many drivers seem to not set correctly. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch