Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1658086pxb; Sun, 10 Jan 2021 06:08:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaQCEzup2YsZihKiBgsR6q+MqYq6B9vMe1sLHfwFj33BLChEhZf2qrNsx5rzkN5R1GLGK6 X-Received: by 2002:aa7:cd15:: with SMTP id b21mr11504131edw.114.1610287730934; Sun, 10 Jan 2021 06:08:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610287730; cv=none; d=google.com; s=arc-20160816; b=kQQ9enzQPrWddUMw6LpjKn0h/E5Dz61L4Ehi/L+Z0/dPC4xLgQG+1VLEuWx2uHfnox Siw7Z9A2CKHVO2BxvNuLD+IslGaS47akqI1djmzYkRWoo8Urfi2csfVDT7vW8DQ5bYpa DFby/AtWcKvmYIKZfeyfec380ixotkWP1hBKjhmn8uV+KJ7py2XvRa/HqCteIGAsBYEp JaTeEq+RLXwkBdWuSq7RfPzlomXdp+dSdW7gEv1ikNdnegQJi/C1q3iKe3MkG8uOOOBu whaGZ6DIq5gbqVh72QF6EBtYJd9Kuck0m8ZUoU+T3TR36LkuX892STtqqXP9TtmSTg0U ApCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zOtHKCqSIIbw45nUFGf2GcagWIsamTSzMZ9NY2lE63Y=; b=ua13IM06BZ8InJfYZwVVgHhN4/581iTSrMRt9P84MwMD0HTBk8rwMELZkJZzSd7x9P UMFMYkSiH176Is16urHFscb3rtIDHwhJ1yMPmYc9qDTUbiSB0W/qUAUARzjEVE5bgX3p lj6L20aVfPS8/XP5I3fS3D7H32otT9EGMJrUsGbsH3Xtg874NQBVox7LKoDUnHbSt8Mt h94nRXpUMhhASel/dFNLDqIBb/3yPNDVe6K1dkkDILSDQu3qF0r8FvDxfZcdz6QPm1GS DtTcNQCL5SuPxRjdAJDAJAK0RP/2qo/Q2aKSa1aCWpYmSb7Of0MJg3BSxojpCgFxVuBb Bs1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jkdL4v0s; 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 nw24si5731632ejb.647.2021.01.10.06.08.26; Sun, 10 Jan 2021 06:08:50 -0800 (PST) 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=jkdL4v0s; 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 S1726579AbhAJOFs (ORCPT + 99 others); Sun, 10 Jan 2021 09:05:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbhAJOFs (ORCPT ); Sun, 10 Jan 2021 09:05:48 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2FF7C061786 for ; Sun, 10 Jan 2021 06:05:07 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id lj6so6207544pjb.0 for ; Sun, 10 Jan 2021 06:05:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zOtHKCqSIIbw45nUFGf2GcagWIsamTSzMZ9NY2lE63Y=; b=jkdL4v0sWJEgwwqMHF3GsdmsH66PEAXwsSSHBaLu9MxcuuDSxTVb6o2NJPzSxgN3pY BED1Mt9vffz75uR/OS+4YmgbsYcakEKEDsV+CFmfcN7lyBo0tJmS6yP8DsbQMJby7YZi iPiNfIvM0uzkuLMJjtuM0duBmcXaeyJe4OC7my+K3uO3ahPx2mK+6w8M0DIreZv5c8Yr mJUnqaEDvHUrGk2pzSDaUvjquiGwzpkUne2c7kxyK//ACxK1pSu+4D+dtjn9T/M5ys9m GQqEEqNtaLnZbH+IxHazb4NsfVWZXSKyudUvTHUE7/5eabiV3swqG+839rVWUt0gX8bx 1Ljg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zOtHKCqSIIbw45nUFGf2GcagWIsamTSzMZ9NY2lE63Y=; b=WyTB46/4pWmzUGjMq2Pz9GjZ4HVMMqL3HIVhrCGto2fYAH9CetdLlaZ2ai2cG4SXkp mnrokicgLbZiF16/WF4SaFYTcOj6KEp114JiTPGc0FpQ0bjxeV+SYib2NjVXwR4YlRYj DiI6b+E7C/dJ0LeTgBKbVSyTjp6P4RjlQVYcI2Ty2ueEn9DBrr5KKbvzP062gfUf0SMD fO6JNZ2e9sUpTP7W/uRokyoLiyYlixMNYxekVP1bmUimOV1GVm/KPd5kVHwl80w/Yu75 zoXGH2vppsHS8oJoi9xK3cbFEErkHo9tgRDhs1cuD6Cm2QZKm1/1450KrwK0gREW7Xda CWdw== X-Gm-Message-State: AOAM532GDIrzryzzswCSimUIzloVBQ8WpbuNNP90hlLb5vo/NdakS5aO wBGTdgvz39SB327l7ZC7F2g= X-Received: by 2002:a17:902:ed45:b029:da:c274:d7ac with SMTP id y5-20020a170902ed45b02900dac274d7acmr12227359plb.69.1610287507249; Sun, 10 Jan 2021 06:05:07 -0800 (PST) Received: from adolin ([49.207.199.194]) by smtp.gmail.com with ESMTPSA id t5sm11317297pjr.22.2021.01.10.06.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 06:05:06 -0800 (PST) Date: Sun, 10 Jan 2021 19:35:02 +0530 From: Sumera Priyadarsini To: melissa.srw@gmail.com Cc: rodrigosiqueiramelo@gmail.com, hamohammed.sa@gmail.com, daniel@ffwll.ch, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH V4 2/3] drm/vkms: Add support for writeback module Message-ID: <15802da4f1cdfed2b728c3d35731732f161dd073.1610200411.git.sylphrenadin@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add enable_writeback feature to vkms_config as a module. Signed-off-by: Sumera Priyadarsini --- drivers/gpu/drm/vkms/vkms_drv.c | 5 +++++ drivers/gpu/drm/vkms/vkms_drv.h | 1 + drivers/gpu/drm/vkms/vkms_output.c | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 6b33975a5cb2..708f7f54001d 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -40,6 +40,10 @@ static bool enable_cursor = true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); +static bool enable_writeback = true; +module_param_named(enable_writeback, enable_writeback, bool, 0444); +MODULE_PARM_DESC(enable_writeback, "Enable/Disable writeback connector support"); + DEFINE_DRM_GEM_FOPS(vkms_driver_fops); static void vkms_release(struct drm_device *dev) @@ -189,6 +193,7 @@ static int __init vkms_init(void) default_config = config; config->cursor = enable_cursor; + config->writeback = enable_writeback; return vkms_create(config); } diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 6a27bd8875f2..b9b4e2bc11c0 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -83,6 +83,7 @@ struct vkms_output { struct vkms_device; struct vkms_config { + bool writeback; bool cursor; /* only set when instantiated */ struct vkms_device *dev; diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 8f3ffb28b9d1..f5f6f15c362c 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -41,6 +41,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) struct drm_crtc *crtc = &output->crtc; struct drm_plane *primary, *cursor = NULL; int ret; + int writeback; primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index); if (IS_ERR(primary)) @@ -80,9 +81,11 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) goto err_attach; } - ret = vkms_enable_writeback_connector(vkmsdev); - if (ret) - DRM_ERROR("Failed to init writeback connector\n"); + if (vkmsdev->config->writeback) { + writeback = vkms_enable_writeback_connector(vkmsdev); + if (writeback) + DRM_ERROR("Failed to init writeback connector\n"); + } drm_mode_config_reset(dev); -- 2.25.1