From patchwork Wed Mar 18 18:25:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 11445821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDAAA139A for ; Wed, 18 Mar 2020 18:25:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D66772077E for ; Wed, 18 Mar 2020 18:25:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D66772077E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E496F6E941; Wed, 18 Mar 2020 18:25:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3B736E93E; Wed, 18 Mar 2020 18:25:23 +0000 (UTC) IronPort-SDR: lRidyU3vZKJO7Hr4IDjvoWpDvxGWfIZbkZ5rG5MDN/UefC11tIxKdOWw+cYUPGLXI8BYRxlCuW goNpxJWl42AQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2020 11:25:23 -0700 IronPort-SDR: pozaC+8KXJwAtw6GsZMjIkuvqAXxWmgIT+qQxAtcRX0J4xtd8CjO/CKM8gZl8rz+Tgipvej8qI 600IOayjyMyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,568,1574150400"; d="scan'208";a="291390565" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by FMSMGA003.fm.intel.com with SMTP; 18 Mar 2020 11:25:18 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 18 Mar 2020 20:25:18 +0200 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: Skip drm_mode_config_validate() for !modeset Date: Wed, 18 Mar 2020 20:25:18 +0200 Message-Id: <20200318182518.31618-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.24.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: intel-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ville Syrjälä drm_mode_config_init() may not have been called when the driver/device doesn't support modeset. That will cause drm_mode_config_validate() to oops. Skip the validation for !modeset. TODO: We may want to consider calling drm_mode_config_init() unconditionally to avoid similar issues elsewhere... Fixes: 74d2aacbe840 ("drm: Validate encoder->possible_clones") Signed-off-by: Ville Syrjälä Reviewed-by: Chris Wilson --- drivers/gpu/drm/drm_mode_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 55322d7048f5..e1ec1bb7068d 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -608,6 +608,9 @@ void drm_mode_config_validate(struct drm_device *dev) { struct drm_encoder *encoder; + if (!drm_core_check_feature(dev, DRIVER_MODESET)) + return; + drm_for_each_encoder(encoder, dev) fixup_encoder_possible_clones(encoder);