Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3647830imm; Fri, 25 May 2018 09:09:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpaf2EiX1+hUC491C4BtaR/omJeEQQ87tlbFyDzAadc6JDoXIq9c6HpkAe1F/k/bN3JITMC X-Received: by 2002:a17:902:2d24:: with SMTP id o33-v6mr3269304plb.14.1527264550034; Fri, 25 May 2018 09:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527264550; cv=none; d=google.com; s=arc-20160816; b=WluO2fxfRxgDA3LSOp247mg9VREXgfQqK+6QDkY092buP/OQEcqAgRgFbUtFvUzHy/ clZZ3glr3yph3nSryYq/RS1I2Ug5uyBFk2EB+S1QPLT7KklxcicC4QE3PpjmsHwK/Ho/ pFkwBRpWy7ZHNMkmPHef6lRaNCU1hw04Bab/o4odjL3XEUz//hHdzSqQmr9DsDJbgkP0 sPSPxKuYiM2KPccjpeC1qm3FCKnlIPXUjZs+sJLnIFLV9PL3q7vLo5Knj+Newx5Woqmo ixdZxBV/WdTzMrR/lJ0gro34sFobJ7L1NQ2DX+ao44n5v1+i59AH+ZsZWf0zjwlixgLF tecg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=cKanJV1JUMu7lF6vGdGSuqIVSu2jWjj0nPgUXxpubbY=; b=EMQsNYjstlgmb69EZaIDF8TwJqIiG6UhfkmVON1MCHFbAQaBpfDyGVGl6bmVAhx0Lq G/xzdrWF9b/N4qmtuRD2KwiAWX5PWwk76b57A5oF7bY93oMGH65rvXSbWCQVJ68u9Tr0 DF2SjOJ56qx4/uIWpeBpszMZ/PAfptRIY0MX1pJRjMTW2/Yh0hWzAf+1GjhZxG9OK6eL 8nVtaLntJ0LroZZdWFUq2CZ4XD7o0HmQUSahfhIIbcFVrgn/dXuZznNqjo2M9xrprgwg CIi1gcM/tKBJ287/7q8+Lc9mTBcvLrEFqPLlRw5OM5Jw9MOMj2cRlZeJZvsZjdFn+Rsv W9bg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l63-v6si23178884plb.49.2018.05.25.09.08.55; Fri, 25 May 2018 09:09:10 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967191AbeEYQIL (ORCPT + 99 others); Fri, 25 May 2018 12:08:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:25866 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966599AbeEYQIK (ORCPT ); Fri, 25 May 2018 12:08:10 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2018 09:08:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,440,1520924400"; d="scan'208";a="52181250" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 25 May 2018 09:08:06 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 25 May 2018 19:08:05 +0300 Date: Fri, 25 May 2018 19:08:05 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Brian Starkey Cc: Ayan Kumar Halder , airlied@linux.ie, alexandru-cosmin.gheorghe@arm.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, nd@arm.com Subject: Re: [PATCH] drm: check_pixel_format() should return true if no modifiers are passed for a supported pixel format Message-ID: <20180525160805.GG23723@intel.com> References: <1527262541-13964-1-git-send-email-ayan.halder@arm.com> <20180525154859.GB1139@e107564-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180525154859.GB1139@e107564-lin.cambridge.arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 04:48:59PM +0100, Brian Starkey wrote: > Hi Ayan, > > On Fri, May 25, 2018 at 04:35:41PM +0100, Ayan Kumar Halder wrote: > >If a plane supports a pixel format and the framebuffer does not pass any > >modifiers, then drm_plane_check_pixel_format() should always return true > >for the given format regardless of whether the plane supports any > >modifiers or not. > > > >Signed-off-by: Ayan Kumar Halder > >--- > > drivers/gpu/drm/drm_plane.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > >diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c > >index 6d2a6e4..873c084 100644 > >--- a/drivers/gpu/drm/drm_plane.c > >+++ b/drivers/gpu/drm/drm_plane.c > >@@ -564,6 +564,9 @@ int drm_plane_check_pixel_format(struct drm_plane *plane, > > if (!plane->modifier_count) > > return 0; > > > >+ if (modifier == DRM_FORMAT_MOD_NONE) > >+ return 0; > >+ > > There can be drivers which have formats which are only supported when > a modifier is used - so I don't think this check is right to have in > the core. > > Drivers need to check if they support the format with no modifier > (same as DRM_FORMAT_MOD_LINEAR) in their format_mod_supported() > callback. BTW I tried to make the core hide the "did the request have modifiers or not" difference as much as possible, and to validate that there is at least one plane that can use the created fb: https://patchwork.freedesktop.org/series/39814/ Not sure we ever figured out a good solution in the end, but at least Eric's approach in https://patchwork.freedesktop.org/series/40133/ would avoid some of the problems I was having in my attempts. I guess I should try to revisit that patchset and see if I can make it less objectionable this time around. > > Thanks, > -Brian > > > for (i = 0; i < plane->modifier_count; i++) { > > if (modifier == plane->modifiers[i]) > > break; > >-- > >2.7.4 > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel