From patchwork Mon Apr 8 19:06:11 2024 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: 13621520 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 429BFCD1292 for ; Mon, 8 Apr 2024 19:06:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC2CE10F874; Mon, 8 Apr 2024 19:06:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="A35BH2al"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id B345F112942; Mon, 8 Apr 2024 19:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712603190; x=1744139190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qd2mOofz2eNc9Qw85grCoUgsywew+5chLlSHFR0+KIs=; b=A35BH2alasEDpputHisD+xESKerXFDh3+oeXhzUw5ot4mvFJFvZywJF9 0LbyD419H8VdvzTwIc5Z9RkcohzGNGo8GjqcV7lTYDQ6lgfrKx4+qfjIC s8cw6MH4Kejx9/4KbIKdZlCHqzFW2Cm3RtCNiUbQvFtY5ZX7Iq7fDEViO 6DBjRxaKNwUzqgc5bTYJO1IFp5MraFP39qHV8jT/mNQlzRfDcoIlCw8rb kW7OHyIg5R5TLtdRvCB9mTvmIKb6ZBF1cjjCB8oi4noFOtCa79RpBXS1J K8EwqRO3qHevwMmSqJRXhAD8wcr4iipLfZF3bfZpr4BD7KOs7PZRJhQwV Q==; X-CSE-ConnectionGUID: tPDeHazjTIiSwJF9MueA7g== X-CSE-MsgGUID: qIE34v9zQFiC8KqcKHxb7Q== X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="19278651" X-IronPort-AV: E=Sophos;i="6.07,187,1708416000"; d="scan'208";a="19278651" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2024 12:06:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="827792380" X-IronPort-AV: E=Sophos;i="6.07,187,1708416000"; d="scan'208";a="827792380" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 08 Apr 2024 12:06:26 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 08 Apr 2024 22:06:25 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter Subject: [PATCH 5/5] drm/vkms: Use drm_crtc_vblank_crtc() Date: Mon, 8 Apr 2024 22:06:11 +0300 Message-ID: <20240408190611.24914-5-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240408190611.24914-1-ville.syrjala@linux.intel.com> References: <20240408190611.24914-1-ville.syrjala@linux.intel.com> 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ville Syrjälä Replace the open coded drm_crtc_vblank_crtc() with the real thing. Cc: Rodrigo Siqueira Cc: Melissa Wen Cc: "Maíra Canal" Cc: Haneen Mohammed Cc: Daniel Vetter Signed-off-by: Ville Syrjälä Reviewed-by: Maíra Canal --- drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 61e500b8c9da..40b4d084e3ce 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -61,9 +61,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) static int vkms_enable_vblank(struct drm_crtc *crtc) { - struct drm_device *dev = crtc->dev; - unsigned int pipe = drm_crtc_index(crtc); - struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; + struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc); struct vkms_output *out = drm_crtc_to_vkms_output(crtc); drm_calc_timestamping_constants(crtc, &crtc->mode); @@ -88,10 +86,9 @@ static bool vkms_get_vblank_timestamp(struct drm_crtc *crtc, bool in_vblank_irq) { struct drm_device *dev = crtc->dev; - unsigned int pipe = crtc->index; struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev); struct vkms_output *output = &vkmsdev->output; - struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; + struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc); if (!READ_ONCE(vblank->enabled)) { *vblank_time = ktime_get();