From: "Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
<intel-xe@lists.freedesktop.org>,
<intel-gfx@lists.freedesktop.org>
Cc: <sowmiya.s@intel.com>, <uma.shankar@intel.com>,
<swati2.sharma@intel.com>, <arun.r.murthy@intel.com>
Subject: Re: [PATCH v3 17/26] drm/i915/writeback: Add the enable sequence from writeback
Date: Tue, 31 Mar 2026 12:46:51 +0530 [thread overview]
Message-ID: <d492ae64-27cf-4823-9bea-48724edff267@intel.com> (raw)
In-Reply-To: <20260325110744.1096786-18-suraj.kandpal@intel.com>
On 3/25/2026 4:37 PM, Suraj Kandpal wrote:
> Add enable sequence for writeback, use encoder->enable hook to
> enable the transcoder.
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> .../gpu/drm/i915/display/intel_writeback.c | 103 ++++++++++++++++++
> 1 file changed, 103 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_writeback.c b/drivers/gpu/drm/i915/display/intel_writeback.c
> index ba4c162847c8..d45d5faaf7cc 100644
> --- a/drivers/gpu/drm/i915/display/intel_writeback.c
> +++ b/drivers/gpu/drm/i915/display/intel_writeback.c
> @@ -17,8 +17,10 @@
>
> #include "intel_atomic.h"
> #include "intel_connector.h"
> +#include "intel_crtc.h"
> #include "intel_de.h"
> #include "intel_display_driver.h"
> +#include "intel_display_regs.h"
> #include "intel_display_types.h"
> #include "intel_display_utils.h"
> #include "intel_fb_pin.h"
> @@ -30,6 +32,7 @@ struct intel_writeback_connector {
> struct intel_encoder encoder;
> struct intel_writeback_job *job;
> enum transcoder trans;
> + enum pipe pipe;
> int frame_num;
> };
>
> @@ -48,6 +51,12 @@ static const u32 writeback_formats[] = {
> DRM_FORMAT_XBGR2101010,
> };
>
> +static struct intel_writeback_connector
> +*enc_to_intel_writeback_connector(struct intel_encoder *encoder)
> +{
> + return container_of(encoder, struct intel_writeback_connector, encoder);
> +}
> +
> static int intel_writeback_connector_init(struct intel_connector *connector)
> {
> struct intel_digital_connector_state *conn_state;
> @@ -215,6 +224,99 @@ static int intel_writeback_atomic_check(struct drm_connector *connector,
> return 0;
> }
>
> +static void intel_writeback_enable_encoder(struct intel_atomic_state *state,
> + struct intel_encoder *encoder,
> + const struct intel_crtc_state *crtc_state,
> + const struct drm_connector_state *conn_state)
> +{
> + struct intel_display *display = to_intel_display(crtc_state);
> + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> + struct intel_writeback_connector *wb_conn =
> + enc_to_intel_writeback_connector(encoder);
> + struct intel_writeback_job *job = wb_conn->job;
> + const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
> + enum transcoder trans = crtc_state->cpu_transcoder;
> + struct intel_crtc *pipe_crtc;
> + struct drm_framebuffer *fb;
> + u32 val = 0, hactive, vactive;
> + int i = 0;
> +
> + if (!conn_state->writeback_job)
> + return;
> +
> + wb_conn->trans = trans;
> + wb_conn->pipe = crtc->pipe;
> + fb = job->fb;
> + hactive = adjusted_mode->hdisplay;
> + vactive = adjusted_mode->vdisplay;
> +
> + /* Configure WD_STRIDE, WD_SURF and WD_TAIL_CFG */
> + /* Enable Planes, Pipes and Transcoder */
> + /* TRANSCODER TIMINGS and other transcoder setting*/
> + /* minimum hactive as per bspec: 64 pixels */
> + if (hactive < 64)
> + drm_err(display->drm, "hactive is less then 64 pixels\n");
> +
> + intel_de_write(display, TRANS_HTOTAL(display, trans), HACTIVE(hactive - 1));
> + intel_de_write(display, TRANS_VTOTAL(display, trans), VACTIVE(vactive - 1));
> +
> + val = 0;
> + /* 2f) Configure and enable TRANS_WD_FUNC_CTL */
> + switch (crtc->pipe) {
> + default:
> + fallthrough;
> + case PIPE_A:
> + val |= WD_INPUT_PIPE_A;
> + break;
> + case PIPE_B:
> + val |= WD_INPUT_PIPE_B;
> + break;
> + case PIPE_C:
> + val |= WD_INPUT_PIPE_C;
> + break;
> + case PIPE_D:
> + val |= WD_INPUT_PIPE_D;
> + break;
> + }
> +
> + switch (fb->format->format) {
> + default:
> + fallthrough;
> + case DRM_FORMAT_YUYV:
> + val |= WD_PIX_FMT_YUYV;
> + break;
> + case DRM_FORMAT_XYUV8888:
> + val |= WD_PIX_FMT_XYUV8888;
> + break;
> + case DRM_FORMAT_XBGR8888:
> + val |= WD_PIX_FMT_XBGR8888;
> + break;
> + case DRM_FORMAT_XBGR2101010:
> + val |= WD_PIX_FMT_XBGR2101010;
> + break;
> + }
Both these can be moved to their own get() functions. Also please add
MISSING_CASE().
> +
> + val |= TRANS_WD_FUNC_ENABLE | WD_TRIGGERED_CAP_MODE_ENABLE |
> + WD_DISABLE_POINTERS;
> + intel_de_write(display, WD_TRANS_FUNC_CTL(trans), val);
> +
> + if (DISPLAY_VER(display) >= 13)
> + intel_de_rmw(display, PIPE_CHICKEN(crtc->pipe),
> + UNDERRUN_RECOVERY_DISABLE_ADLP,
> + UNDERRUN_RECOVERY_DISABLE_ADLP);
> +
> + /* Configure and enable TRANS_CONF */
> + intel_de_write(display, TRANSCONF_WD(trans), WD_TRANS_ENABLE);
> + intel_de_posting_read(display, TRANSCONF_WD(trans));
> +
> + for_each_pipe_crtc_modeset_enable(display, pipe_crtc, crtc_state, i) {
> + const struct intel_crtc_state *pipe_crtc_state =
> + intel_atomic_get_new_crtc_state(state, pipe_crtc);
> +
> + intel_crtc_vblank_on(pipe_crtc_state);
> + }
> +}
> +
> static const struct drm_encoder_funcs drm_writeback_encoder_funcs = {
> .destroy = drm_encoder_cleanup,
> };
> @@ -335,6 +437,7 @@ int intel_writeback_init(struct intel_display *display)
> encoder->get_config = intel_writeback_get_config;
> encoder->get_hw_state = intel_writeback_get_hw_state;
> encoder->compute_config = intel_writeback_compute_config;
> + encoder->enable = intel_writeback_enable_encoder;
>
> connector = &writeback_conn->connector;
> ret = intel_writeback_connector_alloc(connector);
next prev parent reply other threads:[~2026-03-31 7:17 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 11:07 [PATCH v3 00/26] Enable Pipe writeback Suraj Kandpal
2026-03-25 11:07 ` [PATCH v3 DO NOT REVIEW 01/26] drm: writeback: rename drm_writeback_connector_init_with_encoder() Suraj Kandpal
2026-03-25 11:07 ` [PATCH v3 DO NOT REVIEW 02/26] drm: writeback: Refactor drm_writeback_connector structure Suraj Kandpal
2026-03-25 11:07 ` [PATCH v3 03/26] drm/i915/writeback: Add writeback registers Suraj Kandpal
2026-03-25 11:42 ` Ville Syrjälä
2026-03-26 2:31 ` Kandpal, Suraj
2026-03-31 7:12 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 04/26] drm/i915/writeback: Add some preliminary writeback definitions Suraj Kandpal
2026-03-25 11:52 ` Ville Syrjälä
2026-03-26 2:37 ` Kandpal, Suraj
2026-03-31 7:13 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 05/26] drm/i915/writeback: Init writeback connector Suraj Kandpal
2026-03-25 12:15 ` Ville Syrjälä
2026-03-26 2:52 ` Kandpal, Suraj
2026-03-31 7:13 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 06/26] drm/i915/writeback: Add function to get modes Suraj Kandpal
2026-03-31 7:14 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 07/26] drm/i915/writeback: Add hook to check modes Suraj Kandpal
2026-03-25 11:07 ` [PATCH v3 08/26] drm/i915/writeback: Define encoder->get_hw_state Suraj Kandpal
2026-03-25 12:08 ` Ville Syrjälä
2026-03-31 7:15 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 09/26] drm/i915/writeback: Fill encoder->get_config Suraj Kandpal
2026-03-25 12:15 ` Ville Syrjälä
2026-03-26 2:52 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 10/26] drm/i915/writeback: Add private structure for writeback job Suraj Kandpal
2026-03-25 12:17 ` Ville Syrjälä
2026-03-26 2:53 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 11/26] drm/i915/writeback: Define function for prepare and cleanup hooks Suraj Kandpal
2026-03-25 12:29 ` Ville Syrjälä
2026-03-25 11:07 ` [PATCH v3 12/26] drm/i915/writeback: Define compute_config for writeback Suraj Kandpal
2026-03-25 12:19 ` Ville Syrjälä
2026-03-26 3:38 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 13/26] drm/i915/writeback: Define function for connector function detect Suraj Kandpal
2026-03-25 12:22 ` Ville Syrjälä
2026-03-25 11:07 ` [PATCH v3 14/26] drm/i915/writeback: Define function to destroy writeback connector Suraj Kandpal
2026-03-25 12:23 ` Ville Syrjälä
2026-03-26 3:39 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 15/26] drm/i915/writeback: Add connector atomic check Suraj Kandpal
2026-03-25 12:25 ` Ville Syrjälä
2026-03-26 3:43 ` Kandpal, Suraj
2026-03-31 7:16 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 16/26] drm/i915/writeback: Add writeback to xe Makefile Suraj Kandpal
2026-03-25 12:25 ` Ville Syrjälä
2026-03-26 3:44 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 17/26] drm/i915/writeback: Add the enable sequence from writeback Suraj Kandpal
2026-03-25 12:31 ` Ville Syrjälä
2026-03-31 7:16 ` Borah, Chaitanya Kumar [this message]
2026-03-25 11:07 ` [PATCH v3 18/26] drm/i915/writeback: Define writeback frame capture function Suraj Kandpal
2026-03-25 12:33 ` Ville Syrjälä
2026-03-26 3:47 ` Kandpal, Suraj
2026-04-07 8:28 ` Jani Nikula
2026-04-08 3:02 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 19/26] drm/{i915/xe}/writeback: Add a writeback helper to get ggtt address Suraj Kandpal
2026-03-31 7:25 ` Borah, Chaitanya Kumar
2026-04-07 8:32 ` Jani Nikula
2026-04-08 3:24 ` Kandpal, Suraj
2026-04-08 4:11 ` Kandpal, Suraj
2026-03-25 11:07 ` [PATCH v3 20/26] drm/i915/writeback: Configure WD_STRIDE reg Suraj Kandpal
2026-03-25 12:35 ` Ville Syrjälä
2026-03-26 3:52 ` Kandpal, Suraj
2026-03-31 7:17 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 21/26] drm/i915/writeback: Configure WD_SURF register Suraj Kandpal
2026-03-31 7:17 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 22/26] drm/i915/writeback: Enable writeback interrupts Suraj Kandpal
2026-03-25 12:59 ` Ville Syrjälä
2026-03-31 7:19 ` Borah, Chaitanya Kumar
2026-04-07 8:36 ` Jani Nikula
2026-03-25 11:07 ` [PATCH v3 23/26] drm/i915/writeback: Initialize writeback encoder Suraj Kandpal
2026-03-25 13:00 ` Ville Syrjälä
2026-03-26 4:01 ` Kandpal, Suraj
2026-03-31 7:23 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 24/26] drm/i915/writeback: Define the disable sequence for writeback Suraj Kandpal
2026-03-31 7:20 ` Borah, Chaitanya Kumar
2026-03-25 11:07 ` [PATCH v3 25/26] drm/i915/writeback: Make exception for writeback connector Suraj Kandpal
2026-03-31 7:20 ` Borah, Chaitanya Kumar
2026-04-07 8:40 ` Jani Nikula
2026-03-25 11:07 ` [PATCH v3 26/26] drm/i915/writeback: Modify state verify function Suraj Kandpal
2026-03-25 13:01 ` Ville Syrjälä
2026-03-26 3:57 ` Kandpal, Suraj
2026-03-25 11:19 ` ✗ CI.checkpatch: warning for Enable Pipe writeback (rev3) Patchwork
2026-03-25 11:20 ` ✓ CI.KUnit: success " Patchwork
2026-03-25 15:34 ` ✗ Fi.CI.BUILD: failure " Patchwork
2026-04-29 21:27 ` [PATCH v3 00/26] Enable Pipe writeback John Harrison
2026-04-30 2:54 ` Kandpal, Suraj
2026-04-30 20:11 ` John Harrison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d492ae64-27cf-4823-9bea-48724edff267@intel.com \
--to=chaitanya.kumar.borah@intel.com \
--cc=arun.r.murthy@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sowmiya.s@intel.com \
--cc=suraj.kandpal@intel.com \
--cc=swati2.sharma@intel.com \
--cc=uma.shankar@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.