Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10722697imu; Thu, 6 Dec 2018 05:51:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/Udu4zpNbQSuT83PtFJkQM6cwzA8KAR6ArYH/QPp2CRAR/6upYYo11+OfyClFdYPxJD/Apm X-Received: by 2002:a17:902:f01:: with SMTP id 1mr27413705ply.143.1544104308006; Thu, 06 Dec 2018 05:51:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544104307; cv=none; d=google.com; s=arc-20160816; b=VkBjnIQzPvHSuVCS/8wX1ozHNIilVYqdeNT3F07Rms3NGQTzK389BkPDXdhDm8j6BE nky4IAOdJSXwcGB4XG8ZR6dh0UqBKXTvKs5Jy5wgD1TWKQY1K+/mbs6BT2uheHaGrdu3 MeUgYsWyeO1dt1EHV5KkenLQOCEgTzQmdv4+aD+0CfHD+xUuJJ2ikbaRNPsRcI8Z66tF DUoD1xnuRUNB3S0+0E6GscjuDYhjxtZKFpP9x1C56cy8aXJmIX1bpQlQBBBCxtq2n3QC NrYtSF1vzd9LBB6e0Uhu9JfshkuT/Ey5iQqtxWyTVvv6O/XyVLzCZVkQ3gTTjeAH8Nqx UXSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kHqqyzvDWGrf4vXCBaBsWp5c2G+6CDSRVgzJ2s8xReI=; b=wB5GVo7/v87b2j06sHR02kWn+krTJwYfoDow1DYLDy1AIdhb1qSxGtAj0Xg/iyW8lu CAKHMb0ffMddmbCL4ux6W2E3td02Jm1SsgFK2MueK98GZMEABSosTGaVloRlE/YoSBP2 3KPAkICbv2bCChlmOf2cl/4clsrTTExdKJkOydLfag6u0lNsceFXm9S0xzh7RzP4tNM7 lK4W1MM53uuaCVQF9giBvFkztP9KIF95nR9yQwWjdddtPnbGoaSdAxvDysXfwpKHUnqJ 6A43UpIcALoePFUuwh9d/5Yi5B5cspxn6fH+FvvjVqAwCmndRBMwqFXOsIlEz9xUaY7B wgZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f61si354191plb.51.2018.12.06.05.51.31; Thu, 06 Dec 2018 05:51:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729231AbeLFNtf (ORCPT + 99 others); Thu, 6 Dec 2018 08:49:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33684 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727685AbeLFNtf (ORCPT ); Thu, 6 Dec 2018 08:49:35 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB0CD309174F; Thu, 6 Dec 2018 13:49:34 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B35A5FC17; Thu, 6 Dec 2018 13:49:34 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 72B1D8FE4; Thu, 6 Dec 2018 14:49:33 +0100 (CET) Date: Thu, 6 Dec 2018 14:49:33 +0100 From: Gerd Hoffmann To: Frediano Ziglio Cc: dri-devel@lists.freedesktop.org, David Airlie , David Airlie , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , open list , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" Subject: Re: [Spice-devel] [PATCH] drm/qxl: use qxl_num_crtc directly Message-ID: <20181206134933.krvdvoz52lkpewb5@sirius.home.kraxel.org> References: <20181206103352.20587-1-kraxel@redhat.com> <207905511.48580418.1544093965441.JavaMail.zimbra@redhat.com> <20181206114217.vog4fgae73us437u@sirius.home.kraxel.org> <1902655248.48590444.1544100790071.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1902655248.48590444.1544100790071.JavaMail.zimbra@redhat.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 06 Dec 2018 13:49:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 06, 2018 at 07:53:10AM -0500, Frediano Ziglio wrote: > > > > On Thu, Dec 06, 2018 at 05:59:25AM -0500, Frediano Ziglio wrote: > > > > > > > > Just use qxl_num_crtc directly everywhere instead of using > > > > qdev->monitors_config->max_allowed. Drops pointless indirection > > > > and also is less confusing. > > > > > > > > > > To me is MORE confusing, why comparing number of something with > > > another number? Previously code was comparing number of monitors > > > with number of monitors, not number of CRTs with number of > > > monitors. > > > > Yes, spice/qxl and drm/kms use slightly different terminology. > > > > drm crtc == qxl monitor. > > drm framebuffer == qxl surface. > > > > You need to know that anyway when looking at the qxl ksm code. We > > have function names like qxl_crtc_update_monitors_config(). I fail > > to see why that is a problem ... > > > > cheers, > > Gerd > > I don't see any problem too but you are explaining to me > why your rationale "and also is less confusing" does not > stand. Well, it's less confusing because it takes away an indirection (not because of the naming). qdev->monitors_config->max_allowed is effectively set by a module parameter. So using the module parameter variable qxl_num_crtc directly is better IMO. The kernel doesn't need to dereference pointers each time it needs the value, and when reading the code you don't have to trace where and why qdev->monitors_config->max_allowed is set. cheers, Gerd