Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2951986pxa; Tue, 25 Aug 2020 07:44:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw0307tCt7rs+0h6KTFxeoEaCVq2wt1/wljgkh8GSGaGk2zAoQ4kJAybT9CWFUdOzNj7OX X-Received: by 2002:a05:6402:a50:: with SMTP id bt16mr10749206edb.278.1598366671904; Tue, 25 Aug 2020 07:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598366671; cv=none; d=google.com; s=arc-20160816; b=qj/y/FdOiPjx9nu9gSs5TsJ4Zh54OAls8UNvX5UFe8juuZv25aEDi7xmiPv1h38qcM zLoXMlEwbPx+YZvENyovlorg9vDWUu7+7BA2rCZklsmU/IFpdvTUONQXFoGs3R888wW+ BwsBxp9iIqRjJeFkk8tb8hcbmP//iLqB3FSlvBkXCk9tr309bb64Vfn7xkyt3A4IxRFM s/No5sKBWJGFz5acASbwXuc6uPPjJcHY9iXF2s2jINtf2A/rn2/wycx7UAvZtuRjk1h2 SNjEBnAOeCYE09fFzzKbEsIJVPOLLjG4hdVtcLJw6QymBzBPOA1RlYRV6B+AH3JtWvrm 3IwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=QbtdkMQ2OQK8ma+2g5/vN4Ht1Ck+Q+wWJoRTIeRkMdI=; b=FLtLwxF3sRfDZs5WA1b5fHaIJut6vMNV2HcurW01+Tw8EK15EGX5KRDRs9F99JU38U FkjcT8js/A3IvW+PXl+jU+VME7p3Tc46zhPNwMBVZ00+LVRX8NCgN9t5kygIlYpYaj5O Q0Q4nxchFALYLaFDdmUexVyRhzksJOMbL0h+YxH6FvjCAwSZqMjQp1E9d1xSErvBoSAn WCbMibU3qvjE/wtdClpy3wYPHTFexGUjfpDa8BhAuOiZl2dJLMJbgeT1EpdhSkGui5S9 k2G4a/DvrM0eeGUpJuF55sqrDCCF0OrFv6ghEsXoKkXWcs+EIQOLnLElbyR5z+5X3Xfv dAMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YHjNDM1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si2266586ejs.246.2020.08.25.07.44.07; Tue, 25 Aug 2020 07:44:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YHjNDM1A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbgHYOnH (ORCPT + 99 others); Tue, 25 Aug 2020 10:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgHYOnD (ORCPT ); Tue, 25 Aug 2020 10:43:03 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20FAAC061574 for ; Tue, 25 Aug 2020 07:43:03 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id t9so3352694pfq.8 for ; Tue, 25 Aug 2020 07:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=QbtdkMQ2OQK8ma+2g5/vN4Ht1Ck+Q+wWJoRTIeRkMdI=; b=YHjNDM1AlN+oZrQkZvw00RplLB7+Wy/qmjndtc60SzaHIG1/qt6VUHpyBmOv7pXSVz ihuUoNZxgsTMBdx/zsiLr3hq/24i5ZjE0x//qVmbhFFnI23QPcAZjS+SL0bwRfDjn9dr uGt81xBEqZYgR/5TMMI4pgjcEsu19YRwVA0yNoKBh4g992wvAGv6HfyAgLAbSyDmhgkS GuRZc+BjP7lzXdIwpYkYK8x48e7CSKXYsSLHno9yOjzQND2+l8lvLFUlYK3OiEb7V7Me yb8l+FjeyVeXR4I3lwqWZczvqYcC07/OCegqsY5p/P8OLrlxXS8PWbLCzwVKZP/A1rvv YvlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QbtdkMQ2OQK8ma+2g5/vN4Ht1Ck+Q+wWJoRTIeRkMdI=; b=et6kpDSNxmD+oK8YWfac7my3HV+0KfZeZzy/L1qErId9PcrEXB9AjuJ0iCc8eEZHMs jLpcZkMugRHexX05x5boWH1zJwU7EP6joOeBAez4Sv4MRamk/NpDndObZqSkPt3W0GqF dLSC555Aisr9vbmOyj6hYE7qUiUCBXdNlVlXi32bMlz9Y6S2CNuJ7WVMqGGW3cfKvtne zzTdSyYWjU3A6oOFbDdBY3wBBwqABiIVscxXBruJSUNZJwB89XbZKvhQg0156Rk6GnI8 zUreauMwb88j2RfqhP7uL+MYzhIxCy3+QM7ogMwJbHIZ6IX0+H0BAG4forfeSGxkFBY3 2m4A== X-Gm-Message-State: AOAM530XcQenWE84c0cm0eHQSv8pX8awp+xw4UEsAzt6EtfuJuvP79sl q2BGz1Gv8BYnXg+gNFjytJ8= X-Received: by 2002:a63:f44b:: with SMTP id p11mr6831402pgk.324.1598366581203; Tue, 25 Aug 2020 07:43:01 -0700 (PDT) Received: from realwakka.navercorp.com ([61.83.141.80]) by smtp.gmail.com with ESMTPSA id f13sm15087959pfd.215.2020.08.25.07.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 07:43:00 -0700 (PDT) From: Sidong Yang To: Daniel Vetter , Rodrigo Siqueira Cc: Sidong Yang , Haneen Mohammed , melissa.srw@gmail.com, Emil Velikov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vkms: fix warning in vkms_get_vblank_timestamp Date: Tue, 25 Aug 2020 14:42:48 +0000 Message-Id: <20200825144248.1751-1-realwakka@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sidong Yang , Haneen Mohammed When vkms_get_vblank_timestamp() is called very first time without enabling vblank before, vblank time has just intial value and it makes warning message. this patch prevents warning message by setting vblank time to current time. Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Cc: Melissa Wen Signed-off-by: Sidong Yang --- drivers/gpu/drm/vkms/vkms_crtc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index ac85e17428f8..09c012d54d58 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -86,6 +86,11 @@ static bool vkms_get_vblank_timestamp(struct drm_crtc *crtc, struct vkms_output *output = &vkmsdev->output; struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; + if (!READ_ONCE(vblank->enabled)) { + *vblank_time = ktime_get(); + return true; + } + *vblank_time = READ_ONCE(output->vblank_hrtimer.node.expires); if (WARN_ON(*vblank_time == vblank->time)) -- 2.17.1