Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1857368lqa; Tue, 30 Apr 2024 00:54:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUStlK3vs2uaJrqlxRETknDdJelAbTY1qjqxoY5vpVJsmHJ4k00fEh6kSjKRNcujI1dZTmg1y8PRRppoViXcRT5S2cwpzkbTCerrqlrpw== X-Google-Smtp-Source: AGHT+IEc+w78mrO5jzdVTxrUBcYWMq8WdnIZcKw5D7bXAVbrG7feO0rWLiYpaHUKJqDq1973ZGr+ X-Received: by 2002:a05:6808:4c4:b0:3c5:ef28:4ade with SMTP id a4-20020a05680804c400b003c5ef284ademr13384646oie.50.1714463649305; Tue, 30 Apr 2024 00:54:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714463649; cv=pass; d=google.com; s=arc-20160816; b=jaYrPk8K8iHC5cKmVo6jjdoG0eL6daUK4VSFviLeappEnd9V9bKbaJAb6vBupL7sCI xbnWl+5Cfl9SZNAjes4uE2Pfv7bYU7lSGzhl/OuataxPfXJOP/2hnIRovf0mQbSNC6uK 0FEzRasMxgkZTP4C4wT+16mEYeXm50LUe47pEcG1DAjWin21rmNgjC8pT2T41BMibmHs 1WY5W5keC6yqkdB5QRSNpJx791TTE8GT9U8MpwfoeMgijrYWiFVJBC4iwVYzRhNCN9Wn djxCSZC0vvHTxE1GYqM5/XuaWfLaEDH1u3xv4wcxUfvABdq2lneO+x6QlRF3teustui9 S4mQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=dkIznsTVPsWYIptHZrNf6W0WMgEhcy53Bkvb87OnqM4=; fh=+GGkG5nwm2avjslctIBGWrBDkDLOKbieF/TNvGtojbw=; b=ma7i4gY1TxBMTRZZ1tnWax2lLERp0p8s2dYqBK8lKOSCldzX8C6aI6NSlbo1DGDi+3 0J6Wrmv9y8F3rGhbZtol5C2xF4hSb9dxmILubU+lGevaKMdGmGs0f4tuPePYSfqo8fcM NRPyrFGXX8pPE4bk7r6kOEii8OTrE2Wp2XxAPJ1zDj7419I3UURn/2spHRxlJT+pSamC zF+aYdEWSiOFkOHKaoEDv3FBciKkYIZUtg2+UrMEy5byClz8a2rBGRxg3jwuOY4WDnvJ 04wDfmVBcxA/n2jwNQCJ6LR/x8OR7/JVF32MF+QbRVIkTTtD+RC8PRrTSslcqcNSPIGd g7sw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=VtNakjpd; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-163505-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163505-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m11-20020a0562141bcb00b0069b7c08a2dfsi28880073qvc.548.2024.04.30.00.54.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 00:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163505-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=VtNakjpd; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-163505-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163505-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F05B91C22127 for ; Tue, 30 Apr 2024 07:54:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42DC53FE52; Tue, 30 Apr 2024 07:54:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="VtNakjpd" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C284314AB7 for ; Tue, 30 Apr 2024 07:54:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714463642; cv=none; b=eUHSE+b21BILMsgQppdLeCuK4mPmMtJxoO8HJRk8LALm+sJqQJhNRRqfTPLcqsBOZy36CKMHIndTz6UTq9d/wWhE5JSLw9wpzt1SfW6axGGRDgtGWuzzFIZfISeBKNb4Ayf2LqdCGCjr2YqrpjVgheQZQPESY9butwkukSMzQzA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714463642; c=relaxed/simple; bh=se22KIrBv/ObwxX8+h7A9VYhSWLAtj0CzwKSEDOXfgM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XKYlU3qlJCmlq5txPRpVpcfe8s9Jgw30Phd7InCPI3j2V5E2Wz72FV2Q9tAriBz0EfYJcl15OV4SAq45Bm0b6UfRv3/RGzlU6wK1rwS2KgUcHxazy5qdE107XA+WchdzjVy8Fw8e9YZSYgKDBtzZCA1/YqBU6NAFwofSFOd3J/A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=VtNakjpd; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-41c02fb8cebso1776675e9.1 for ; Tue, 30 Apr 2024 00:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1714463639; x=1715068439; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=dkIznsTVPsWYIptHZrNf6W0WMgEhcy53Bkvb87OnqM4=; b=VtNakjpdpNxb//B8/bjGrEmbv1zyZoaaDAVc79VBOxyUnL3gt8q8DZOOqMMVjpGmLm z9QVRu3Fn6SZrSnQ4Ne9m8My/G7x5EibOWJQhJR7vJgkSueJLBlAciHMT+qc/IDOT/Kg gmXj/t2WWDTfvkN8BuAlpL2q01BWfxyaLrw0M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714463639; x=1715068439; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dkIznsTVPsWYIptHZrNf6W0WMgEhcy53Bkvb87OnqM4=; b=URddHQFgAuuM9Ey9f/CkeEHmeRClMIvwgryXng9m55ubi4gtjyYh8/P9FwCeocY2U+ w1DBuhCUizQh2xEXsYqODzneMVqDCEXn8StFdF0baOCCIrtX7Ef3UYOnSjO9Ms683z5o 8Hl7gs6jaR6ZQogZiq83MNS1tibp5k0GO9R3VYd003R5kGWzcOwm4R2qUumGuyYoktRr qfhNaxT6fxV24v50S0fDQELhZLTNorYucP6qUqlZhe/1XdJKqgo2WQG5ljP2vhnaIO+u vY95F0INRk2eWnGmoMWuGZZ3Wzgbc0x8tUCuyXfSI9YRzd7dhIewUdywzlo04MFItIm7 e95Q== X-Forwarded-Encrypted: i=1; AJvYcCUA90lmRTT/ItyPS23rWq8sPKk7E8jAx1Tgi/pdKPv9f9czetCemRaRyQ1Ja61fRpznPzwxTgmgh1neOJwy/60Bnj+Xf9qaXfeidV9I X-Gm-Message-State: AOJu0YyBJ8vBOxyTGTeeheRJi3FB9IluW2wNc9q2J7zoWknF2ygXJ8Xg 8/CFz/XA6fxdu7zSfHc2kZxTCGRSyg3HYLrS5syZp8d9IrjC8xExeuNSFXJpw/s= X-Received: by 2002:a5d:5f52:0:b0:34a:a754:eb51 with SMTP id cm18-20020a5d5f52000000b0034aa754eb51mr9835367wrb.3.1714463639173; Tue, 30 Apr 2024 00:53:59 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id v2-20020adfe282000000b00346ceb9e060sm31316803wri.103.2024.04.30.00.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 00:53:58 -0700 (PDT) Date: Tue, 30 Apr 2024 09:53:56 +0200 From: Daniel Vetter To: Brandon Pollack Cc: marius.vlad@collabora.com, mairacanal@riseup.net, jshargo@chromium.org, hamohammed.sa@gmail.com, rodrigosiqueiramelo@gmail.com, linux-doc@vger.kernel.org, hirono@chromium.org, corbet@lwn.net, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, melissa.srw@gmail.com, mduggan@chromium.org, mripard@kernel.org, tzimmermann@suse.de Subject: Re: [PATCH v6 3/7] drm/vkms: Provide platform data when creating VKMS devices Message-ID: Mail-Followup-To: Brandon Pollack , marius.vlad@collabora.com, mairacanal@riseup.net, jshargo@chromium.org, hamohammed.sa@gmail.com, rodrigosiqueiramelo@gmail.com, linux-doc@vger.kernel.org, hirono@chromium.org, corbet@lwn.net, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, melissa.srw@gmail.com, mduggan@chromium.org, mripard@kernel.org, tzimmermann@suse.de References: <20230829053201.423261-1-brpol@chromium.org> <20230829053201.423261-4-brpol@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230829053201.423261-4-brpol@chromium.org> X-Operating-System: Linux phenom 6.6.15-amd64 On Tue, Aug 29, 2023 at 05:30:55AM +0000, Brandon Pollack wrote: > From: Jim Shargo > > This is a small refactor to make ConfigFS support easier. This should be > a no-op refactor. > > Signed-off-by: Jim Shargo > Signed-off-by: Brandon Pollack This should be part of the series to switch over to a real platform driver, since we only need that with that design and not with the current setup/init code. -Sima > --- > drivers/gpu/drm/vkms/vkms_drv.c | 14 ++++++++++++-- > drivers/gpu/drm/vkms/vkms_drv.h | 9 ++++++--- > drivers/gpu/drm/vkms/vkms_output.c | 2 +- > 3 files changed, 19 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c > index 65b1e2c52106..6c94c2b5d529 100644 > --- a/drivers/gpu/drm/vkms/vkms_drv.c > +++ b/drivers/gpu/drm/vkms/vkms_drv.c > @@ -9,6 +9,7 @@ > * the GPU in DRM API tests. > */ > > +#include "asm-generic/errno-base.h" > #include > #include > #include > @@ -171,12 +172,14 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev) > dev->mode_config.preferred_depth = 0; > dev->mode_config.helper_private = &vkms_mode_config_helpers; > > - return vkms_output_init(vkmsdev, 0); > + return vkmsdev->is_default ? vkms_output_init_default(vkmsdev) : > + -EINVAL; > } > > static int vkms_platform_probe(struct platform_device *pdev) > { > int ret; > + struct vkms_device_setup *vkms_device_setup = pdev->dev.platform_data; > struct vkms_device *vkms_device; > void *grp; > > @@ -195,6 +198,7 @@ static int vkms_platform_probe(struct platform_device *pdev) > vkms_device->config.cursor = enable_cursor; > vkms_device->config.writeback = enable_writeback; > vkms_device->config.overlay = enable_overlay; > + vkms_device->is_default = vkms_device_setup->is_default; > > ret = dma_coerce_mask_and_coherent(vkms_device->drm.dev, > DMA_BIT_MASK(64)); > @@ -258,6 +262,9 @@ static int __init vkms_init(void) > { > int ret; > struct platform_device *pdev; > + struct vkms_device_setup vkms_device_setup = { > + .is_default = true, > + }; > > ret = platform_driver_register(&vkms_platform_driver); > if (ret) { > @@ -265,8 +272,11 @@ static int __init vkms_init(void) > return ret; > } > > - pdev = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); > + 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); > } > diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h > index 761cd809617e..4262dcffd7e1 100644 > --- a/drivers/gpu/drm/vkms/vkms_drv.h > +++ b/drivers/gpu/drm/vkms/vkms_drv.h > @@ -132,17 +132,20 @@ struct vkms_output { > struct vkms_plane planes[VKMS_MAX_PLANES]; > }; > > -struct vkms_device; > - > struct vkms_config { > bool writeback; > bool cursor; > bool overlay; > }; > > +struct vkms_device_setup { > + bool is_default; > +}; > + > struct vkms_device { > struct drm_device drm; > struct platform_device *platform; > + bool is_default; > struct vkms_output output; > struct vkms_config config; > }; > @@ -166,7 +169,7 @@ struct vkms_crtc *vkms_crtc_init(struct vkms_device *vkmsdev, > struct drm_plane *primary, > struct drm_plane *cursor); > > -int vkms_output_init(struct vkms_device *vkmsdev, int index); > +int vkms_output_init_default(struct vkms_device *vkmsdev); > > struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, > enum drm_plane_type type); > diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c > index 86faf94f7408..bfc2e2362c6d 100644 > --- a/drivers/gpu/drm/vkms/vkms_output.c > +++ b/drivers/gpu/drm/vkms/vkms_output.c > @@ -80,7 +80,7 @@ static struct drm_encoder *vkms_encoder_init(struct vkms_device *vkms_device) > return encoder; > } > > -int vkms_output_init(struct vkms_device *vkmsdev, int index) > +int vkms_output_init_default(struct vkms_device *vkmsdev) > { > struct vkms_output *output = &vkmsdev->output; > struct drm_device *dev = &vkmsdev->drm; > -- > 2.42.0.rc2.253.gd59a3bf2b4-goog > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch