Received: by 10.223.185.116 with SMTP id b49csp759686wrg; Fri, 23 Feb 2018 06:25:22 -0800 (PST) X-Google-Smtp-Source: AH8x225ZhAkuKulG2ONEMPoqcMWcIEqBk6KARQv3HE+k6zWiP4tHb+XTOc/lO7+wbfKsBVpn5bEK X-Received: by 2002:a17:902:9885:: with SMTP id s5-v6mr1935736plp.400.1519395922268; Fri, 23 Feb 2018 06:25:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519395922; cv=none; d=google.com; s=arc-20160816; b=uB/2l+4Ap7RzIxIh7bfnY8mN/a5RTgFZVf9KP1w1l+MxrPjo2EZtzWg6r4XIqSy7a2 kPtmOd0fgTt401o7GhNAIzsKmevgPhlYW6of50EBdp4sPypOFMWmj6+qoxB0zInf9QFO vDQb6b1CzJ79Xia8wtOIFiGrTgI3P8Ut8TqfLH39q4MAj6k39cGA8uMJ36v8pb0xAMss cfLQOz33G0DHynea3SnxByLpolL1fvPGyEkVodha6s8xTPwan9BhoIjZStG6vf9V/Kmw 3yBU+VX3P1pjy44lL6WAszx4MQ0Kf0XJwhLvYJ9h0Eh9NdjpRMPOBVMmTYZOPz1Crkdk 7zRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=dGF1w5RuweIDXWXQJp60IAr98QZ2jP2+EidZY9LTqJ8=; b=nrgwu8Oew9JqlT2jnnKddphFLgpGH7yB0xUjgQ7ikgtnC2c2aVkOcrG4oK7oVS/1Jy Wk+lW3weIGaHoxvM0pYzg+YPRsdKp54sBkohC2gSetXe3JPRdB7Cg2RyTgGyV/ppEYuw Kwld6iHHSiKC8qx90d9DSEhP55jf41SuFMc+TSMm8Egtcwrk+q9gtCZ7sQ0EzSpaBdAR I9TSI6pMBSJFF+X2qUmNSD0DfwXHqFTuBPFrt+R/E8QPQjzDvYqcu0uQTcYgntt3XYoa cpPVXY/lLls86iArGhi2mahufG3sZgoOvRlU2Rwpra7Bv6SEu4W3hAbIpqh7ePsFzRkN nTog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQtgbJaS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22-v6si1860772pli.594.2018.02.23.06.25.07; Fri, 23 Feb 2018 06:25:22 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQtgbJaS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbeBWOYO (ORCPT + 99 others); Fri, 23 Feb 2018 09:24:14 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:34067 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbeBWOYM (ORCPT ); Fri, 23 Feb 2018 09:24:12 -0500 Received: by mail-it0-f67.google.com with SMTP id a203so5075662itd.1; Fri, 23 Feb 2018 06:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dGF1w5RuweIDXWXQJp60IAr98QZ2jP2+EidZY9LTqJ8=; b=LQtgbJaSFHMUVxjEbdLfqiV+e0yE0WBYNq7eIsTiFwzqIVGJtg+bqxNtoaqxkoUo+4 HbbPyOWX5G9OQg+xWmigx5IUwVwtxdsnbX5Lu3KtRBN/NX0oK6qc7RbjPyOANfbMXU4a S8sxdy+siXaXfo9lkmwfSBof1/Ak+IlH2R8wW982gvu09OjU4X3ugl8GziFhJGjxD87b 2nnq9CPL7qDi/khHCTriBy+FU3+KxQmgnXBiqLanSdTI+LzG0LJuH8kTJ3SQi/cbtU5Q nn1PHZ5dMQv2Ih6B2Zel8o0oPb3cZcQUx8qhQOQL+f7ZfWRAH2z67pJnvjbBgx5sSmQI STnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dGF1w5RuweIDXWXQJp60IAr98QZ2jP2+EidZY9LTqJ8=; b=MoOkx7v5Kdiar0cR7Q/Vajovkuxyg39TG+7ZiRjR1Id9vMA8YCWskbaNZ23nw/khly V8Uej234z0GPxXCXc6McMmTVli/fz2KqQixbIqoHKRIbaO/llNnXx/PaQddLyI63/YhU 3J0kX647ab9dvWDsMtQdFDIgo6qDQTmfWWBxYV7WUZO8MFEgJwFHAxarR6UYicQow5+P YyFcnrnM/Vo1rguOumtGf/LpfCkM8uyAY7FOzWBI7hHBVXN8uQTp4P4+SIUTcHyg+Opj zQ08aRLzCL6ODCV8xzuxvBnfM4uN7UYHJ1JeGCbkE2lcQpvz0NpPaHn2HLLpTTrhOjhw vssQ== X-Gm-Message-State: APf1xPAdLkDa2kdCwyxAf9B5hE5UZ0kXi8y7J0LmbZ1mG35PIdmKOg+R UHncuc11mGeq1VyvcHBXP03we2J002R8dzfNXlM= X-Received: by 10.36.0.130 with SMTP id 124mr2594090ita.143.1519395851232; Fri, 23 Feb 2018 06:24:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.90.131 with HTTP; Fri, 23 Feb 2018 06:24:10 -0800 (PST) In-Reply-To: <20180223140018.GV9111@e110455-lin.cambridge.arm.com> References: <20180223131758.18362-1-robdclark@gmail.com> <20180223131758.18362-2-robdclark@gmail.com> <20180223140018.GV9111@e110455-lin.cambridge.arm.com> From: Rob Clark Date: Fri, 23 Feb 2018 09:24:10 -0500 Message-ID: Subject: Re: [RFC 1/4] drm: Add writeback connector type To: Liviu Dudau Cc: dri-devel , freedreno , linux-arm-msm , Brian Starkey , Mihail Atanassov , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , Jonathan Corbet , linux-doc@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 9:00 AM, Liviu Dudau wrote: > Hi Rob, > > On Fri, Feb 23, 2018 at 08:17:51AM -0500, Rob Clark wrote: >> From: Brian Starkey >> >> Writeback connectors represent writeback engines which can write the >> CRTC output to a memory framebuffer. Add a writeback connector type and >> related support functions. >> >> Drivers should initialize a writeback connector with >> drm_writeback_connector_init() which takes care of setting up all the >> writeback-specific details on top of the normal functionality of >> drm_connector_init(). >> >> Writeback connectors have a WRITEBACK_FB_ID property, used to set the >> output framebuffer, and a WRITEBACK_PIXEL_FORMATS blob used to expose th= e >> supported writeback formats to userspace. >> >> When a framebuffer is attached to a writeback connector with the >> WRITEBACK_FB_ID property, it is used only once (for the commit in which >> it was included), and userspace can never read back the value of >> WRITEBACK_FB_ID. WRITEBACK_FB_ID can only be set if the connector is >> attached to a CRTC. > > [snip] > >> +static bool create_writeback_properties(struct drm_device *dev) >> +{ >> + struct drm_property *prop; >> + >> + if (!dev->mode_config.writeback_fb_id_property) { >> + prop =3D drm_property_create_object(dev, DRM_MODE_PROP_ATO= MIC, >> + "WRITEBACK_FB_ID", >> + DRM_MODE_OBJECT_FB); >> + if (!prop) >> + return false; >> + dev->mode_config.writeback_fb_id_property =3D prop; >> + } >> + >> + if (!dev->mode_config.writeback_pixel_formats_property) { >> + prop =3D drm_property_create(dev, DRM_MODE_PROP_BLOB | DRM= _MODE_PROP_IMMUTABLE, >> + "WRITEBACK_PIXEL_FORMATS", 0); >> + if (!prop) >> + return false; >> + dev->mode_config.writeback_pixel_formats_property =3D prop= ; >> + } >> + >> + return true; >> +} > > based on a buildbot warning and the fact that the next patch starts > returning -ENOMEM inside the above function, I have this variant in my > internal tree that I was preparing to send out once I've got my i-g-t > tests in better shape: > > +static int create_writeback_properties(struct drm_device *dev) > +{ > + struct drm_property *prop; > + > + if (!dev->mode_config.writeback_fb_id_property) { > + prop =3D drm_property_create_object(dev, DRM_MODE_PROP_AT= OMIC, > + "WRITEBACK_FB_ID", > + DRM_MODE_OBJECT_FB); > + if (!prop) > + return -ENOMEM; > + dev->mode_config.writeback_fb_id_property =3D prop; > + } > + > + if (!dev->mode_config.writeback_pixel_formats_property) { > + prop =3D drm_property_create(dev, DRM_MODE_PROP_BLOB | DR= M_MODE_PROP_IMMUTABLE, > + "WRITEBACK_PIXEL_FORMATS", 0); > + if (!prop) > + return -ENOMEM; > + dev->mode_config.writeback_pixel_formats_property =3D pro= p; > + } > + > + return 0; > +} > > > Feel free to use this version in the next update if you're going to send > one, otherwise I guess we could be patching it later. > hmm, I meant to keep my addition of funcs->atomic_commit() as a separate fixup patch so it would be easier for you to fold back into your patchset, but accidentally squashed it at some point and was too lazy to split it out again. Sorry about that. BR, -R > Best regards, > Liviu > > >> + >> +static const struct drm_encoder_funcs drm_writeback_encoder_funcs =3D { >> + .destroy =3D drm_encoder_cleanup, >> +}; >> + >> +/** >> + * drm_writeback_connector_init - Initialize a writeback connector and = its properties >> + * @dev: DRM device >> + * @wb_connector: Writeback connector to initialize >> + * @con_funcs: Connector funcs vtable >> + * @enc_helper_funcs: Encoder helper funcs vtable to be used by the int= ernal encoder >> + * @formats: Array of supported pixel formats for the writeback engine >> + * @n_formats: Length of the formats array >> + * >> + * This function creates the writeback-connector-specific properties if= they >> + * have not been already created, initializes the connector as >> + * type DRM_MODE_CONNECTOR_WRITEBACK, and correctly initializes the pro= perty >> + * values. It will also create an internal encoder associated with the >> + * drm_writeback_connector and set it to use the @enc_helper_funcs vtab= le for >> + * the encoder helper. >> + * >> + * Drivers should always use this function instead of drm_connector_ini= t() to >> + * set up writeback connectors. >> + * >> + * Returns: 0 on success, or a negative error code >> + */ >> +int drm_writeback_connector_init(struct drm_device *dev, >> + struct drm_writeback_connector *wb_connec= tor, >> + const struct drm_connector_funcs *con_fun= cs, >> + const struct drm_encoder_helper_funcs *en= c_helper_funcs, >> + const u32 *formats, int n_formats) >> +{ >> + int ret; >> + struct drm_property_blob *blob; >> + struct drm_connector *connector =3D &wb_connector->base; >> + struct drm_mode_config *config =3D &dev->mode_config; >> + >> + if (!create_writeback_properties(dev)) >> + return -EINVAL; >> + >> + blob =3D drm_property_create_blob(dev, n_formats * sizeof(*formats= ), >> + formats); >> + if (IS_ERR(blob)) >> + return PTR_ERR(blob); >> + >> + drm_encoder_helper_add(&wb_connector->encoder, enc_helper_funcs); >> + ret =3D drm_encoder_init(dev, &wb_connector->encoder, >> + &drm_writeback_encoder_funcs, >> + DRM_MODE_ENCODER_VIRTUAL, NULL); >> + if (ret) >> + goto fail; >> + >> + connector->interlace_allowed =3D 0; >> + >> + ret =3D drm_connector_init(dev, connector, con_funcs, >> + DRM_MODE_CONNECTOR_WRITEBACK); >> + if (ret) >> + goto connector_fail; >> + >> + ret =3D drm_mode_connector_attach_encoder(connector, >> + &wb_connector->encoder); >> + if (ret) >> + goto attach_fail; >> + >> + INIT_LIST_HEAD(&wb_connector->job_queue); >> + spin_lock_init(&wb_connector->job_lock); >> + >> + drm_object_attach_property(&connector->base, >> + config->writeback_fb_id_property, 0); >> + >> + drm_object_attach_property(&connector->base, >> + config->writeback_pixel_formats_propert= y, >> + blob->base.id); >> + wb_connector->pixel_formats_blob_ptr =3D blob; >> + >> + return 0; >> + >> +attach_fail: >> + drm_connector_cleanup(connector); >> +connector_fail: >> + drm_encoder_cleanup(&wb_connector->encoder); >> +fail: >> + drm_property_unreference_blob(blob); >> + return ret; >> +} >> +EXPORT_SYMBOL(drm_writeback_connector_init); >> + >> +/** >> + * drm_writeback_queue_job - Queue a writeback job for later signalling >> + * @wb_connector: The writeback connector to queue a job on >> + * @job: The job to queue >> + * >> + * This function adds a job to the job_queue for a writeback connector.= It >> + * should be considered to take ownership of the writeback job, and so = any other >> + * references to the job must be cleared after calling this function. >> + * >> + * Drivers must ensure that for a given writeback connector, jobs are q= ueued in >> + * exactly the same order as they will be completed by the hardware (an= d >> + * signaled via drm_writeback_signal_completion). >> + * >> + * For every call to drm_writeback_queue_job() there must be exactly on= e call to >> + * drm_writeback_signal_completion() >> + * >> + * See also: drm_writeback_signal_completion() >> + */ >> +void drm_writeback_queue_job(struct drm_writeback_connector *wb_connect= or, >> + struct drm_writeback_job *job) >> +{ >> + unsigned long flags; >> + >> + spin_lock_irqsave(&wb_connector->job_lock, flags); >> + list_add_tail(&job->list_entry, &wb_connector->job_queue); >> + spin_unlock_irqrestore(&wb_connector->job_lock, flags); >> +} >> +EXPORT_SYMBOL(drm_writeback_queue_job); >> + >> +/** >> + * drm_writeback_cleanup_job - Cleanup and free a writeback job >> + * @job: The writeback job to free >> + * >> + * Drops any references held by the writeback job, and frees the struct= ure. >> + */ >> +void drm_writeback_cleanup_job(struct drm_writeback_job *job) >> +{ >> + if (!job) >> + return; >> + >> + if (job->fb) >> + drm_framebuffer_unreference(job->fb); >> + kfree(job); >> +} >> +EXPORT_SYMBOL(drm_writeback_cleanup_job); >> + >> +/* >> + * @cleanup_work: deferred cleanup of a writeback job >> + * >> + * The job cannot be cleaned up directly in drm_writeback_signal_comple= tion, >> + * because it may be called in interrupt context. Dropping the framebuf= fer >> + * reference can sleep, and so the cleanup is deferred to a workqueue. >> + */ >> +static void cleanup_work(struct work_struct *work) >> +{ >> + struct drm_writeback_job *job =3D container_of(work, >> + struct drm_writeback_= job, >> + cleanup_work); >> + drm_writeback_cleanup_job(job); >> +} >> + >> +/** >> + * drm_writeback_signal_completion - Signal the completion of a writeba= ck job >> + * @wb_connector: The writeback connector whose job is complete >> + * >> + * Drivers should call this to signal the completion of a previously qu= eued >> + * writeback job. It should be called as soon as possible after the har= dware >> + * has finished writing, and may be called from interrupt context. >> + * It is the driver's responsibility to ensure that for a given connect= or, the >> + * hardware completes writeback jobs in the same order as they are queu= ed. >> + * >> + * Unless the driver is holding its own reference to the framebuffer, i= t must >> + * not be accessed after calling this function. >> + * >> + * See also: drm_writeback_queue_job() >> + */ >> +void >> +drm_writeback_signal_completion(struct drm_writeback_connector *wb_conn= ector) >> +{ >> + unsigned long flags; >> + struct drm_writeback_job *job; >> + >> + spin_lock_irqsave(&wb_connector->job_lock, flags); >> + job =3D list_first_entry_or_null(&wb_connector->job_queue, >> + struct drm_writeback_job, >> + list_entry); >> + if (job) >> + list_del(&job->list_entry); >> + spin_unlock_irqrestore(&wb_connector->job_lock, flags); >> + >> + if (WARN_ON(!job)) >> + return; >> + >> + INIT_WORK(&job->cleanup_work, cleanup_work); >> + queue_work(system_long_wq, &job->cleanup_work); >> +} >> +EXPORT_SYMBOL(drm_writeback_signal_completion); >> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h >> index cf13842a6dbd..d7b0263cc5cf 100644 >> --- a/include/drm/drm_atomic.h >> +++ b/include/drm/drm_atomic.h >> @@ -594,6 +594,9 @@ void drm_atomic_set_fence_for_plane(struct drm_plane= _state *plane_state, >> int __must_check >> drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_stat= e, >> struct drm_crtc *crtc); >> +int drm_atomic_set_writeback_fb_for_connector( >> + struct drm_connector_state *conn_state, >> + struct drm_framebuffer *fb); >> int __must_check >> drm_atomic_add_affected_connectors(struct drm_atomic_state *state, >> struct drm_crtc *crtc); >> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h >> index 758a176e7b57..8701ebcc68b3 100644 >> --- a/include/drm/drm_connector.h >> +++ b/include/drm/drm_connector.h >> @@ -425,6 +425,19 @@ struct drm_connector_state { >> * protection. This is most commonly used for HDCP. >> */ >> unsigned int content_protection; >> + >> + /** >> + * @writeback_job: Writeback job for writeback connectors >> + * >> + * Holds the framebuffer for a writeback connector. As the writeba= ck >> + * completion may be asynchronous to the normal commit cycle, the >> + * writeback job lifetime is managed separately from the normal at= omic >> + * state by this object. >> + * >> + * See also: drm_writeback_queue_job() and >> + * drm_writeback_signal_completion() >> + */ >> + struct drm_writeback_job *writeback_job; >> }; >> >> /** >> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config= .h >> index 7569f22ffef6..c012e1148ec0 100644 >> --- a/include/drm/drm_mode_config.h >> +++ b/include/drm/drm_mode_config.h >> @@ -779,6 +779,20 @@ struct drm_mode_config { >> */ >> struct drm_property *panel_orientation_property; >> >> + /** >> + * @writeback_fb_id_property: Property for writeback connectors, s= toring >> + * the ID of the output framebuffer. >> + * See also: drm_writeback_connector_init() >> + */ >> + struct drm_property *writeback_fb_id_property; >> + /** >> + * @writeback_pixel_formats_property: Property for writeback conne= ctors, >> + * storing an array of the supported pixel formats for the writeba= ck >> + * engine (read-only). >> + * See also: drm_writeback_connector_init() >> + */ >> + struct drm_property *writeback_pixel_formats_property; >> + >> /* dumb ioctl parameters */ >> uint32_t preferred_depth, prefer_shadow; >> >> diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_= modeset_helper_vtables.h >> index 3e76ca805b0f..97d3a810bc85 100644 >> --- a/include/drm/drm_modeset_helper_vtables.h >> +++ b/include/drm/drm_modeset_helper_vtables.h >> @@ -974,6 +974,17 @@ struct drm_connector_helper_funcs { >> */ >> int (*atomic_check)(struct drm_connector *connector, >> struct drm_connector_state *state); >> + >> + /** >> + * @atomic_commit: >> + * >> + * For write-back connectors, this is the point to commit the writ= e- >> + * back job to hw. >> + * >> + * This callback is used by the atomic modeset helpers. >> + */ >> + void (*atomic_commit)(struct drm_connector *connector, >> + struct drm_writeback_job *writeback_job); >> }; >> >> /** >> diff --git a/include/drm/drm_writeback.h b/include/drm/drm_writeback.h >> new file mode 100644 >> index 000000000000..0bb95fd4907d >> --- /dev/null >> +++ b/include/drm/drm_writeback.h >> @@ -0,0 +1,89 @@ >> +/* >> + * (C) COPYRIGHT 2016 ARM Limited. All rights reserved. >> + * Author: Brian Starkey >> + * >> + * This program is free software and is provided to you under the terms= of the >> + * GNU General Public License version 2 as published by the Free Softwa= re >> + * Foundation, and any use by you of this program is subject to the ter= ms >> + * of such GNU licence. >> + */ >> + >> +#ifndef __DRM_WRITEBACK_H__ >> +#define __DRM_WRITEBACK_H__ >> +#include >> +#include >> +#include >> + >> +struct drm_writeback_connector { >> + struct drm_connector base; >> + >> + /** >> + * @encoder: Internal encoder used by the connector to fulfill >> + * the DRM framework requirements. The users of the >> + * @drm_writeback_connector control the behaviour of the @encoder >> + * by passing the @enc_funcs parameter to drm_writeback_connector_= init() >> + * function. >> + */ >> + struct drm_encoder encoder; >> + >> + /** >> + * @pixel_formats_blob_ptr: >> + * >> + * DRM blob property data for the pixel formats list on writeback >> + * connectors >> + * See also drm_writeback_connector_init() >> + */ >> + struct drm_property_blob *pixel_formats_blob_ptr; >> + >> + /** @job_lock: Protects job_queue */ >> + spinlock_t job_lock; >> + >> + /** >> + * @job_queue: >> + * >> + * Holds a list of a connector's writeback jobs; the last item is = the >> + * most recent. The first item may be either waiting for the hardw= are >> + * to begin writing, or currently being written. >> + * >> + * See also: drm_writeback_queue_job() and >> + * drm_writeback_signal_completion() >> + */ >> + struct list_head job_queue; >> +}; >> +#define to_wb_connector(x) container_of(x, struct drm_writeback_connect= or, base) >> + >> +struct drm_writeback_job { >> + /** >> + * @cleanup_work: >> + * >> + * Used to allow drm_writeback_signal_completion to defer dropping= the >> + * framebuffer reference to a workqueue. >> + */ >> + struct work_struct cleanup_work; >> + /** >> + * @list_entry: >> + * >> + * List item for the connector's @job_queue >> + */ >> + struct list_head list_entry; >> + /** >> + * @fb: >> + * >> + * Framebuffer to be written to by the writeback connector. Do not= set >> + * directly, use drm_atomic_set_writeback_fb_for_connector() >> + */ >> + struct drm_framebuffer *fb; >> +}; >> + >> +int drm_writeback_connector_init(struct drm_device *dev, >> + struct drm_writeback_connector *wb_connec= tor, >> + const struct drm_connector_funcs *con_fun= cs, >> + const struct drm_encoder_helper_funcs *en= c_helper_funcs, >> + const u32 *formats, int n_formats); >> + >> +void drm_writeback_queue_job(struct drm_writeback_connector *wb_connect= or, >> + struct drm_writeback_job *job); >> + >> +void drm_writeback_cleanup_job(struct drm_writeback_job *job); >> +void drm_writeback_signal_completion(struct drm_writeback_connector *wb= _connector); >> +#endif >> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h >> index 2c575794fb52..7b47e184e95e 100644 >> --- a/include/uapi/drm/drm_mode.h >> +++ b/include/uapi/drm/drm_mode.h >> @@ -338,6 +338,7 @@ enum drm_mode_subconnector { >> #define DRM_MODE_CONNECTOR_VIRTUAL 15 >> #define DRM_MODE_CONNECTOR_DSI 16 >> #define DRM_MODE_CONNECTOR_DPI 17 >> +#define DRM_MODE_CONNECTOR_WRITEBACK 18 >> >> struct drm_mode_get_connector { >> >> -- >> 2.14.3 >> > > -- > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > | I would like to | > | fix the world, | > | but they're not | > | giving me the | > \ source code! / > --------------- > =C2=AF\_(=E3=83=84)_/=C2=AF