Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D212FC28D13 for ; Mon, 22 Aug 2022 17:28:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C11C9B86C; Mon, 22 Aug 2022 17:28:28 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 85A789B81B; Mon, 22 Aug 2022 17:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661189287; x=1692725287; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=9ElP/IwqxhNOlWFt/bRl8Zyn5hdwF2/4tZbor7mkJK8=; b=F5mQ6w94cEyLeDbmkodxvisjrfiChxPbKgUEIb1DyEZivWeT0c9fIXGR WsjdtskSX2trmoCCpJ6P4l0hherfOQbXCNUCfFe5HwZVhefHnojYBP2zg HKRQ2HjgnO6KAOmCH4C02zWscX/Xh1B3PcLy5xCEpC/oSSzZciA38MM7K YYuXS4oFT2ov24HkCrhereMKOYe/5jr+qczQeeQeWNTowH3m+2wFHUKPd hdaA3YR9lB4RkMIulz33C+KZn/i8032J2Kg3xQp/9sZux4ZqldxvkT/mU uwg1mVJikG+8R1ou/0QltgabgPdv9R7lJumJw5c401xLLr4nvangTki4Q A==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="357457722" X-IronPort-AV: E=Sophos;i="5.93,255,1654585200"; d="scan'208";a="357457722" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 10:28:06 -0700 X-IronPort-AV: E=Sophos;i="5.93,255,1654585200"; d="scan'208";a="854560472" Received: from ideak-desk.fi.intel.com ([10.237.72.175]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 10:28:04 -0700 Date: Mon, 22 Aug 2022 20:28:00 +0300 From: Imre Deak To: Andrzej Hajda Subject: Re: [PATCH v6 4/4] drm/i915/fbdev: do not create fbdev if HPD is suspended Message-ID: References: <20220722125143.1604709-1-andrzej.hajda@intel.com> <20220722125143.1604709-5-andrzej.hajda@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220722125143.1604709-5-andrzej.hajda@intel.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: imre.deak@intel.com Cc: Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rodrigo Vivi , Arun R Murthy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Jul 22, 2022 at 02:51:43PM +0200, Andrzej Hajda wrote: > In case of deferred FB setup core can try to create new > framebuffer. Disallow it if hpd_suspended flag is set. > > Signed-off-by: Andrzej Hajda Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/display/intel_fbdev.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c > index 94ddc0f34fde64..fb8dbd532b9e05 100644 > --- a/drivers/gpu/drm/i915/display/intel_fbdev.c > +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c > @@ -210,6 +210,12 @@ static int intelfb_create(struct drm_fb_helper *helper, > struct drm_i915_gem_object *obj; > int ret; > > + mutex_lock(&ifbdev->hpd_lock); > + ret = ifbdev->hpd_suspended ? -EAGAIN : 0; > + mutex_unlock(&ifbdev->hpd_lock); > + if (ret) > + return ret; > + > if (intel_fb && > (sizes->fb_width > intel_fb->base.width || > sizes->fb_height > intel_fb->base.height)) { > -- > 2.25.1 >