Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp792481rdb; Sun, 20 Aug 2023 03:08:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbxk2hR4Ha669cHM/4d4ROIVIc5JGO52z6VU4bN9H4SHAbg3CkP1XM0NRmH5U2p3o85kfs X-Received: by 2002:a05:6a20:840c:b0:140:3cc7:b3a6 with SMTP id c12-20020a056a20840c00b001403cc7b3a6mr5838749pzd.4.1692526083692; Sun, 20 Aug 2023 03:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692526083; cv=none; d=google.com; s=arc-20160816; b=JXX1xdFjf4iAo9tGvmGw7jpNuYZt93rIsUOMLFQl52N2e2rQi17zgmguKA0NCIksC5 0kAMT7kROpo7cg+NdBJgJVd7sth8RztWN9lgKWk6FPH0bg/p2WCDHH6CDd7H3Ux5Xq5W 0GCGQV1Om2Fs84zVyA6nDiZ24C73CrW6u+uLN2mM5CYP/wIwVT79JFbxqKwhj/QR5W8u rf+TigqA6cRc7zxPbMPrC4p6fysz9EmspeQ7fO5b9LDQa5QmNCHmiMxqHPV4trUz3PpY cVXHQfl/zjI87z4CsFsgqYml0mtzma7yTA82fPFTZVbzI4yCxzLecMdOKhOwjzskjEEu jy8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6ivYpwW9DO3lSrQDhw7QRJZzEj2WsxNzf3Yq1gbJej4=; fh=YIOzYfCvykxXxdunTxr5O/sH5+s9xkrCn92RSUSndCc=; b=LnihSIuFnI+YZHY9DByDJz7WUeN34oJs0U3iwt7DRvvTgtIT8/WaOfHVHFZJ69aF9s NJYgAIjmIBwBkp04XxkD8rZ9zUgQr/c6PJc+StYjY4pkzoMIbB+8Q8B/dyP4XYuGg6tw SScpEE6KASmBd+ZT/baQonTsyIr4rZdLr9n9Y+Z95M+mau1DOsHuw0i0haBld1Urdho2 3rMmHkhd5npS3K4UvtlI8dIoRrqhmuyp37I7N1eUgCuQ88pMeYX6c1Tb7IJTFezf9/D1 K6ZnYg/rIUoA7CUubs8YEmaZ0UErs1BMHlfKIu7lwdv9gmCHHNvRSR1X2QSyH9md7u35 GCbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CRKAQV8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t17-20020a639551000000b00565f2784db2si5121773pgn.517.2023.08.20.03.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 03:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CRKAQV8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8DBAC3184D4; Sat, 19 Aug 2023 11:58:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244436AbjHRFjp (ORCPT + 99 others); Fri, 18 Aug 2023 01:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357111AbjHRFjR (ORCPT ); Fri, 18 Aug 2023 01:39:17 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D24E26B6 for ; Thu, 17 Aug 2023 22:39:13 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bdc8081147so11892995ad.1 for ; Thu, 17 Aug 2023 22:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692337153; x=1692941953; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6ivYpwW9DO3lSrQDhw7QRJZzEj2WsxNzf3Yq1gbJej4=; b=CRKAQV8WOuLHZYJvitnCVMzITyjpSHKmHOQShy1S13INVDUswDwxQaZPfg3ss0jGGo t5wMjm3LSZz7YEaOvEm8sqrFvj1ByM/yZ4IC9SH2rlVu/F+MewkLseQQ+wVycGibJQLv 8SUA51hDgUbZpguT5fs/R2QxkLxRfHyX5W59c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692337153; x=1692941953; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ivYpwW9DO3lSrQDhw7QRJZzEj2WsxNzf3Yq1gbJej4=; b=cOkA6oV+FwAu3tOb+fGKENU3jf7kb8q3Kaus7mPD5WCFnlIQC9lpBGOoMyBAqwE5p1 6zwMbYQbzPXYXAwRl3Cp1mfKS3ONaSW361o0oar7ROjC2qUFe+dvaoRc0KbTV+USLIBU lqwoic5ed/jy6nN8JaF0JJveuGsLuzTWL3flL/Ghm99ssEsNJpeRUXkod3Hppvzni0gF SiQnrGFk3lSVeqAVhF2VgNR8YIzzdUhDHhHa4Pwlc2/UtG7eEZp3SG93ztRdBXmWDUiV oDOx339W5tw7ZyzzxrNrO72TBHUSAH1D39gl1Zsh9+8QkmoE2t+ViY6NhV9LlVwMILk6 5o/w== X-Gm-Message-State: AOJu0YxqEO6V4CoxFBPDlziwh7mC+HImQ/3Gm6XRj/8V2xVfmaG5f6yL Py0b4hooXELXmT2Ni+Ms80EMaw== X-Received: by 2002:a17:903:2446:b0:1bd:b073:a567 with SMTP id l6-20020a170903244600b001bdb073a567mr1964207pls.31.1692337153007; Thu, 17 Aug 2023 22:39:13 -0700 (PDT) Received: from ?IPV6:2401:fa00:8f:203:4e9f:532f:e004:aaa1? ([2401:fa00:8f:203:4e9f:532f:e004:aaa1]) by smtp.gmail.com with ESMTPSA id q1-20020a170902dac100b001b864add154sm741856plx.154.2023.08.17.22.39.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Aug 2023 22:39:12 -0700 (PDT) Message-ID: <6620ac6e-ffe4-f7b9-2213-1a4e3382cf9a@chromium.org> Date: Fri, 18 Aug 2023 14:39:08 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: [PATCH v2 6/6] drm/vkms: Add a module param to enable/disable the default device Content-Language: en-US To: Maira Canal , Jim Shargo , Daniel Vetter , David Airlie , Haneen Mohammed , Jonathan Corbet , Maarten Lankhorst , Maxime Ripard , Melissa Wen , Rodrigo Siqueira , Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230623222353.97283-1-jshargo@chromium.org> <20230623222353.97283-7-jshargo@chromium.org> <64c40359-d0ee-5070-2a52-033c7e655e0a@riseup.net> From: Brandon Ross Pollack In-Reply-To: <64c40359-d0ee-5070-2a52-033c7e655e0a@riseup.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/26/23 03:04, Maira Canal wrote: > Hi Jim, > > On 6/23/23 19:23, Jim Shargo wrote: >> In many testing circumstances, we will want to just create a new device >> and test against that. If we create a default device, it can be annoying >> to have to manually select the new device instead of choosing the only >> one that exists. >> >> The param, enable_default, is defaulted to true to maintain backwards >> compatibility. >> >> Signed-off-by: Jim Shargo >> --- >>   drivers/gpu/drm/vkms/vkms_drv.c | 44 ++++++++++++++++++++++----------- >>   1 file changed, 29 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c >> b/drivers/gpu/drm/vkms/vkms_drv.c >> index 314a04659c5f..1cb56c090a65 100644 >> --- a/drivers/gpu/drm/vkms/vkms_drv.c >> +++ b/drivers/gpu/drm/vkms/vkms_drv.c >> @@ -42,17 +42,26 @@ >>   #define DRIVER_MAJOR    1 >>   #define DRIVER_MINOR    0 >>   +static bool enable_default_device = true; >> +module_param_named(enable_default_device, enable_default_device, >> bool, 0444); >> +MODULE_PARM_DESC(enable_default_device, >> +         "Enable/Disable creating the default device"); > > Wouldn't be better to just call it "enable_default"? At the risk of being annoyingly pedantic, I actually like the original name better because it makes it clear it is an entire device and setup, including the planes/encoders/connectors/crtcs needed and connecting them as necessary etc.  I just feel "device" here makes it clearer what is the default thing. > > Also, could you add this parameter to vkms_config debugfs file? But of course! This is the last comment before I send out the new series. Thank you so much for your time, looking forward to the next round of comments. > > Best Regards, > - Maíra > >> + >>   static bool enable_cursor = true; >>   module_param_named(enable_cursor, enable_cursor, bool, 0444); >> -MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); >> +MODULE_PARM_DESC(enable_cursor, >> +         "Enable/Disable cursor support for the default device"); >>     static bool enable_writeback = true; >>   module_param_named(enable_writeback, enable_writeback, bool, 0444); >> -MODULE_PARM_DESC(enable_writeback, "Enable/Disable writeback >> connector support"); >> +MODULE_PARM_DESC( >> +    enable_writeback, >> +    "Enable/Disable writeback connector support for the default >> device"); >>     static bool enable_overlay; >>   module_param_named(enable_overlay, enable_overlay, bool, 0444); >> -MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support"); >> +MODULE_PARM_DESC(enable_overlay, >> +         "Enable/Disable overlay support for the default device"); >>     DEFINE_DRM_GEM_FOPS(vkms_driver_fops); >>   @@ -278,10 +287,7 @@ void vkms_remove_device(struct vkms_device >> *vkms_device) >>   static int __init vkms_init(void) >>   { >>       int ret; >> -    struct platform_device *pdev; >> -    struct vkms_device_setup vkms_device_setup = { >> -        .configfs = NULL, >> -    }; >> +    struct platform_device *default_pdev = NULL; >>         ret = platform_driver_register(&vkms_platform_driver); >>       if (ret) { >> @@ -289,19 +295,27 @@ static int __init vkms_init(void) >>           return ret; >>       } >>   -    pdev = platform_device_register_data(NULL, DRIVER_NAME, 0, >> -                         &vkms_device_setup, >> -                         sizeof(vkms_device_setup)); >> -    if (IS_ERR(pdev)) { >> -        DRM_ERROR("Unable to register default vkms device\n"); >> -        platform_driver_unregister(&vkms_platform_driver); >> -        return PTR_ERR(pdev); >> +    if (enable_default_device) { >> +        struct vkms_device_setup vkms_device_setup = { >> +            .configfs = NULL, >> +        }; >> + >> +        default_pdev = platform_device_register_data( >> +            NULL, DRIVER_NAME, 0, &vkms_device_setup, >> +            sizeof(vkms_device_setup)); >> +        if (IS_ERR(default_pdev)) { >> +            DRM_ERROR("Unable to register default vkms device\n"); >> + platform_driver_unregister(&vkms_platform_driver); >> +            return PTR_ERR(default_pdev); >> +        } >>       } >>         ret = vkms_init_configfs(); >>       if (ret) { >>           DRM_ERROR("Unable to initialize configfs\n"); >> -        platform_device_unregister(pdev); >> +        if (default_pdev) >> +            platform_device_unregister(default_pdev); >> + >>           platform_driver_unregister(&vkms_platform_driver); >>       } > > From mboxrd@z Thu Jan  1 00:00:00 1970 > 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 AB561C0015E >     for ; Sun, 25 Jun 2023 18:04:15 > +0000 (UTC) > Received: from gabe.freedesktop.org (localhost [127.0.0.1]) >     by gabe.freedesktop.org (Postfix) with ESMTP id D153310E18C; >     Sun, 25 Jun 2023 18:04:14 +0000 (UTC) > Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) > by gabe.freedesktop.org (Postfix) with ESMTPS id C6BE910E187 > for ; Sun, 25 Jun 2023 18:04:12 +0000 > (UTC) > Received: from fews01-sea.riseup.net (fews01-sea-pn.riseup.net > [10.0.1.109]) > (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) > key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest > SHA256) > (No client certificate requested) > by mx1.riseup.net (Postfix) with ESMTPS id 4QpzPl6CHTzDrNy; > Sun, 25 Jun 2023 18:04:11 +0000 (UTC) > DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; > s=squak; > t=1687716252; bh=3cOd9Tulf+RLZ2R/lGuVfEdERy8xqZ4HHWjkWZv3FAs=; > h=Date:Subject:To:Cc:References:From:In-Reply-To:From; > b=lXentHTOo29YwgA/Q5WAgBBEUsl5DTqsmOJd4wsjxBgZocgZ/PG9hmyBm6a2IjvcQ > jSPI26UWubdYOe7kngWhcU0/oO570ofVUyrxiNgiJQfcscdp5bpwrskBKK4yXdJc0q > 2YM4+n0xeBBSr2pFLMDwbOsLDvaGUK77nSPcbPXQ= > X-Riseup-User-ID: > 7EBE90DED2258EE1CA830B796CBA05FD63338D890F31F4C1BCCCB27A6DA77A56 > Received: from [127.0.0.1] (localhost [127.0.0.1]) > by fews01-sea.riseup.net (Postfix) with ESMTPSA id 4QpzPg4YpbzJntB; > Sun, 25 Jun 2023 18:04:07 +0000 (UTC) > Message-ID: <64c40359-d0ee-5070-2a52-033c7e655e0a@riseup.net> > Date: Sun, 25 Jun 2023 15:04:05 -0300 > MIME-Version: 1.0 > Subject: Re: [PATCH v2 6/6] drm/vkms: Add a module param to > enable/disable the > default device > Content-Language: en-US > To: Jim Shargo , Daniel Vetter , > David Airlie , Haneen Mohammed > , > Jonathan Corbet , > Maarten Lankhorst , > Maxime Ripard , Melissa Wen , > Rodrigo Siqueira , > Thomas Zimmermann > References: <20230623222353.97283-1-jshargo@chromium.org> > <20230623222353.97283-7-jshargo@chromium.org> > From: Maira Canal > In-Reply-To: <20230623222353.97283-7-jshargo@chromium.org> > Content-Type: text/plain; charset=UTF-8; format=flowed > Content-Transfer-Encoding: 8bit > 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: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, > linux-doc@vger.kernel.org > Errors-To: dri-devel-bounces@lists.freedesktop.org > Sender: "dri-devel" > > Hi Jim, > > On 6/23/23 19:23, Jim Shargo wrote: >> In many testing circumstances, we will want to just create a new device >> and test against that. If we create a default device, it can be annoying >> to have to manually select the new device instead of choosing the only >> one that exists. >> >> The param, enable_default, is defaulted to true to maintain backwards >> compatibility. >> >> Signed-off-by: Jim Shargo >> --- >>   drivers/gpu/drm/vkms/vkms_drv.c | 44 ++++++++++++++++++++++----------- >>   1 file changed, 29 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c >> b/drivers/gpu/drm/vkms/vkms_drv.c >> index 314a04659c5f..1cb56c090a65 100644 >> --- a/drivers/gpu/drm/vkms/vkms_drv.c >> +++ b/drivers/gpu/drm/vkms/vkms_drv.c >> @@ -42,17 +42,26 @@ >>   #define DRIVER_MAJOR    1 >>   #define DRIVER_MINOR    0 >>   +static bool enable_default_device = true; >> +module_param_named(enable_default_device, enable_default_device, >> bool, 0444); >> +MODULE_PARM_DESC(enable_default_device, >> +         "Enable/Disable creating the default device"); > > Wouldn't be better to just call it "enable_default"? > > Also, could you add this parameter to vkms_config debugfs file? > > Best Regards, > - Maíra > >> + >>   static bool enable_cursor = true; >>   module_param_named(enable_cursor, enable_cursor, bool, 0444); >> -MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); >> +MODULE_PARM_DESC(enable_cursor, >> +         "Enable/Disable cursor support for the default device"); >>     static bool enable_writeback = true; >>   module_param_named(enable_writeback, enable_writeback, bool, 0444); >> -MODULE_PARM_DESC(enable_writeback, "Enable/Disable writeback >> connector support"); >> +MODULE_PARM_DESC( >> +    enable_writeback, >> +    "Enable/Disable writeback connector support for the default >> device"); >>     static bool enable_overlay; >>   module_param_named(enable_overlay, enable_overlay, bool, 0444); >> -MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support"); >> +MODULE_PARM_DESC(enable_overlay, >> +         "Enable/Disable overlay support for the default device"); >>     DEFINE_DRM_GEM_FOPS(vkms_driver_fops); >>   @@ -278,10 +287,7 @@ void vkms_remove_device(struct vkms_device >> *vkms_device) >>   static int __init vkms_init(void) >>   { >>       int ret; >> -    struct platform_device *pdev; >> -    struct vkms_device_setup vkms_device_setup = { >> -        .configfs = NULL, >> -    }; >> +    struct platform_device *default_pdev = NULL; >>         ret = platform_driver_register(&vkms_platform_driver); >>       if (ret) { >> @@ -289,19 +295,27 @@ static int __init vkms_init(void) >>           return ret; >>       } >>   -    pdev = platform_device_register_data(NULL, DRIVER_NAME, 0, >> -                         &vkms_device_setup, >> -                         sizeof(vkms_device_setup)); >> -    if (IS_ERR(pdev)) { >> -        DRM_ERROR("Unable to register default vkms device\n"); >> -        platform_driver_unregister(&vkms_platform_driver); >> -        return PTR_ERR(pdev); >> +    if (enable_default_device) { >> +        struct vkms_device_setup vkms_device_setup = { >> +            .configfs = NULL, >> +        }; >> + >> +        default_pdev = platform_device_register_data( >> +            NULL, DRIVER_NAME, 0, &vkms_device_setup, >> +            sizeof(vkms_device_setup)); >> +        if (IS_ERR(default_pdev)) { >> +            DRM_ERROR("Unable to register default vkms device\n"); >> + platform_driver_unregister(&vkms_platform_driver); >> +            return PTR_ERR(default_pdev); >> +        } >>       } >>         ret = vkms_init_configfs(); >>       if (ret) { >>           DRM_ERROR("Unable to initialize configfs\n"); >> -        platform_device_unregister(pdev); >> +        if (default_pdev) >> +            platform_device_unregister(default_pdev); >> + >>           platform_driver_unregister(&vkms_platform_driver); >>       } >