From patchwork Fri Feb 25 01:30:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 12759516 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 9E2EFC433F5 for ; Fri, 25 Feb 2022 01:30:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A0A1C10E1D0; Fri, 25 Feb 2022 01:30:36 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1A4610E14A; Fri, 25 Feb 2022 01:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645752635; x=1677288635; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=LhMXHECP8VjSeyLSOaUahnS9eB7Fq2oF4pATO9AKlo4=; b=LnxlOErPD402U/OKc9iUOJa4KTMg5JJlPAHpPcWO1r8YZBaVy5v9eUxz Avmknswy+ULA/tE7h2j/UwDOfhypm0+bR1M77rthlXXX7tvvPz7JmcZ5o hENAgbPEbk2ajegxDKOrEW16RrESPNgZs8YnMLA/HoYvbruELU3yDFB2e etKUZnxVkYtWo5CNBhWPIpUynn02hhxOaM2EbCpf63bNMyIKk/a8nN6TR mtfILffjE9gD4Pn2s6K8FLXq6lmg+ThD0UpSgsgQLINuoyospOW6zwaEc eJsOSKVr//5zhggCm6GPt+je7ovrhCZUDgDZd6Bf5wVOSRALGxSPGJTs3 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="232366323" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="232366323" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 17:30:34 -0800 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="639948931" Received: from labuser-z97x-ud5h.jf.intel.com ([10.165.21.211]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Feb 2022 17:30:34 -0800 From: Manasi Navare To: intel-gfx@lists.freedesktop.org Subject: [PATCH v6 1/2] drm/vrr: Set VRR capable prop only if it is attached to connector Date: Thu, 24 Feb 2022 17:30:54 -0800 Message-Id: <20220225013055.9282-1-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 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: , Cc: Manasi Navare , Jani Nikula , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" VRR capable property is not attached by default to the connector It is attached only if VRR is supported. So if the driver tries to call drm core set prop function without it being attached that causes NULL dereference. Cc: Jani Nikula Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Manasi Navare Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_connector.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index a50c82bc2b2f..76a8c707c34b 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2330,6 +2330,9 @@ EXPORT_SYMBOL(drm_connector_atomic_hdr_metadata_equal); void drm_connector_set_vrr_capable_property( struct drm_connector *connector, bool capable) { + if (!connector->vrr_capable_property) + return; + drm_object_property_set_value(&connector->base, connector->vrr_capable_property, capable);