mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: lyude@redhat.com
To: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>,
	 linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org,
	Danilo Krummrich <dakr@kernel.org>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann	 <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter	 <simona@ffwll.ch>,
	Mary Guillemard <mary@mary.zone>,
		nouveau@lists.freedesktop.org
Subject: Re: [PATCH v2 06/10] drm/nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware
Date: Fri, 21 Aug 2026 18:02:14 -0400	[thread overview]
Message-ID: <b91ad24281d52efd681f24e7f954f684104a84a7.camel@redhat.com> (raw)
In-Reply-To: <20260820164929.17117-7-mohamedahmedegypt2001@gmail.com>

We should probably Cc this to stable. With that fixed:

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Thu, 2026-08-20 at 20:49 +0400, Mohamed Ahmed wrote:
> NVIDIA removed the deprecated actualPclkHz/linkClkFreqHz fields and
> the
> whole Legacy{activeCnt, activeFrac, activePolarity, mvidWarEnabled,
> MvidWarParams} block from the SST sub-struct of
> NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS between the 535 and 570
> releases
> (compared in OpenRM tags 535.113.01 vs 570.144), shrinking the
> struct.
> 
> Everything nouveau writes sits at identical offsets in both layouts
> except the trailing SST.bEnableAudioOverRightPanel (written as zero),
> but
> the size is wrong on r570, which means r535_sor_dp_sst() and
> r535_sor_dp_vcpi() are sent with an incorrect size.
> 
> Route the .sst/.vcpi IOR functions through nvkm_rm_api_disp the same
> way
> bl_ctrl and dp.get_caps/set_indexed_link_rates already are. Keep the
> existing implementation for r535 and add an r570 implementation built
> against the 570.144 layout, which already exists in r570/nvrm/disp.h
> but
> was unused until now. Also add the NV0073_CTRL_CMD_DP_CONFIG_STREAM
> define that was missing from the layout.
> 
> Other DP controls sent through shared r535 code did not change layout
> between the tags.
> 
> Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
> ---
>  .../nouveau/nvkm/subdev/gsp/rm/r535/disp.c    | 33 ++++++++--
>  .../nouveau/nvkm/subdev/gsp/rm/r570/disp.c    | 64
> +++++++++++++++++++
>  .../nvkm/subdev/gsp/rm/r570/nvrm/disp.h       |  2 +
>  .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h   |  5 ++
>  4 files changed, 97 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> index f3e55253bcbc..3a8ff621ed62 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> @@ -400,16 +400,16 @@ r535_sor_dp_audio(struct nvkm_ior *sor, int
> head, bool enable)
>  		r535_sor_dp_audio_mute(sor, false);
>  }
>  
> -static void
> -r535_sor_dp_vcpi(struct nvkm_ior *sor, int head, u8 slot, u8
> slot_nr, u16 pbn, u16 aligned_pbn)
> +static int
> +r535_dp_vcpi(struct nvkm_ior *sor, int head, u8 slot, u8 slot_nr,
> u16 pbn, u16 aligned_pbn)
>  {
>  	struct nvkm_disp *disp = sor->disp;
>  	struct NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl;
>  
>  	ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom,
>  				   
> NV0073_CTRL_CMD_DP_CONFIG_STREAM, sizeof(*ctrl));
> -	if (WARN_ON(IS_ERR(ctrl)))
> -		return;
> +	if (IS_ERR(ctrl))
> +		return PTR_ERR(ctrl);
>  
>  	ctrl->subDeviceInstance = 0;
>  	ctrl->head = head;
> @@ -429,12 +429,20 @@ r535_sor_dp_vcpi(struct nvkm_ior *sor, int
> head, u8 slot, u8 slot_nr, u16 pbn, u
>  	ctrl->MST.sendACT = 0;
>  	ctrl->MST.singleHeadMSTPipeline = 0;
>  	ctrl->MST.bEnableAudioOverRightPanel = 0;
> -	WARN_ON(nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl));
> +	return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl);
> +}
> +
> +static void
> +r535_sor_dp_vcpi(struct nvkm_ior *sor, int head, u8 slot, u8
> slot_nr, u16 pbn, u16 aligned_pbn)
> +{
> +	const struct nvkm_rm_api *rmapi = sor->disp-
> >engine.subdev.device->gsp->rm->api;
> +
> +	WARN_ON(rmapi->disp->dp.vcpi(sor, head, slot, slot_nr, pbn,
> aligned_pbn));
>  }
>  
>  static int
> -r535_sor_dp_sst(struct nvkm_ior *sor, int head, bool ef,
> -		u32 watermark, u32 hblanksym, u32 vblanksym)
> +r535_dp_sst(struct nvkm_ior *sor, int head, bool ef,
> +	    u32 watermark, u32 hblanksym, u32 vblanksym)
>  {
>  	struct nvkm_disp *disp = sor->disp;
>  	struct NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl;
> @@ -461,6 +469,15 @@ r535_sor_dp_sst(struct nvkm_ior *sor, int head,
> bool ef,
>  	return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl);
>  }
>  
> +static int
> +r535_sor_dp_sst(struct nvkm_ior *sor, int head, bool ef,
> +		u32 watermark, u32 hblanksym, u32 vblanksym)
> +{
> +	const struct nvkm_rm_api *rmapi = sor->disp-
> >engine.subdev.device->gsp->rm->api;
> +
> +	return rmapi->disp->dp.sst(sor, head, ef, watermark,
> hblanksym, vblanksym);
> +}
> +
>  static const struct nvkm_ior_func_dp
>  r535_sor_dp = {
>  	.sst = r535_sor_dp_sst,
> @@ -1771,6 +1788,8 @@ r535_disp = {
>  	.dp = {
>  		.get_caps = r535_dp_get_caps,
>  		.set_indexed_link_rates =
> r535_dp_set_indexed_link_rates,
> +		.sst = r535_dp_sst,
> +		.vcpi = r535_dp_vcpi,
>  	},
>  	.chan = {
>  		.set_pushbuf = r535_disp_chan_set_pushbuf,
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
> index a96e31c2d80b..8a23837f356e 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
> @@ -5,6 +5,7 @@
>  #include <rm/rm.h>
>  
>  #include <engine/disp.h>
> +#include <engine/disp/ior.h>
>  #include <engine/disp/outp.h>
>  
>  #include "nvhw/drf.h"
> @@ -74,6 +75,67 @@ r570_disp_chan_set_pushbuf(struct nvkm_disp *disp,
> s32 oclass, int inst, struct
>  	return nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice,
> ctrl);
>  }
>  
> +static int
> +r570_dp_vcpi(struct nvkm_ior *sor, int head, u8 slot, u8 slot_nr,
> u16 pbn, u16 aligned_pbn)
> +{
> +	struct nvkm_disp *disp = sor->disp;
> +	NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl;
> +
> +	ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom,
> +				   
> NV0073_CTRL_CMD_DP_CONFIG_STREAM, sizeof(*ctrl));
> +	if (IS_ERR(ctrl))
> +		return PTR_ERR(ctrl);
> +
> +	ctrl->subDeviceInstance = 0;
> +	ctrl->head = head;
> +	ctrl->sorIndex = sor->id;
> +	ctrl->dpLink = sor->asy.link == 2;
> +	ctrl->bEnableOverride = 1;
> +	ctrl->bMST = 1;
> +	ctrl->hBlankSym = 0;
> +	ctrl->vBlankSym = 0;
> +	ctrl->colorFormat = 0;
> +	ctrl->bEnableTwoHeadOneOr = 0;
> +	ctrl->singleHeadMultistreamMode = 0;
> +	ctrl->MST.slotStart = slot;
> +	ctrl->MST.slotEnd = slot + slot_nr - 1;
> +	ctrl->MST.PBN = pbn;
> +	ctrl->MST.Timeslice = aligned_pbn;
> +	ctrl->MST.sendACT = 0;
> +	ctrl->MST.singleHeadMSTPipeline = 0;
> +	ctrl->MST.bEnableAudioOverRightPanel = 0;
> +	return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl);
> +}
> +
> +static int
> +r570_dp_sst(struct nvkm_ior *sor, int head, bool ef,
> +	    u32 watermark, u32 hblanksym, u32 vblanksym)
> +{
> +	struct nvkm_disp *disp = sor->disp;
> +	NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl;
> +
> +	ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom,
> +				   
> NV0073_CTRL_CMD_DP_CONFIG_STREAM, sizeof(*ctrl));
> +	if (IS_ERR(ctrl))
> +		return PTR_ERR(ctrl);
> +
> +	ctrl->subDeviceInstance = 0;
> +	ctrl->head = head;
> +	ctrl->sorIndex = sor->id;
> +	ctrl->dpLink = sor->asy.link == 2;
> +	ctrl->bEnableOverride = 1;
> +	ctrl->bMST = 0;
> +	ctrl->hBlankSym = hblanksym;
> +	ctrl->vBlankSym = vblanksym;
> +	ctrl->colorFormat = 0;
> +	ctrl->bEnableTwoHeadOneOr = 0;
> +	ctrl->SST.bEnhancedFraming = ef;
> +	ctrl->SST.tuSize = 64;
> +	ctrl->SST.waterMark = watermark;
> +	ctrl->SST.bEnableAudioOverRightPanel = 0;
> +	return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl);
> +}
> +
>  static int
>  r570_dp_set_indexed_link_rates(struct nvkm_outp *outp)
>  {
> @@ -255,6 +317,8 @@ r570_disp = {
>  	.dp = {
>  		.get_caps = r570_dp_get_caps,
>  		.set_indexed_link_rates =
> r570_dp_set_indexed_link_rates,
> +		.sst = r570_dp_sst,
> +		.vcpi = r570_dp_vcpi,
>  	},
>  	.chan = {
>  		.set_pushbuf = r570_disp_chan_set_pushbuf,
> diff --git
> a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/nvrm/disp.h
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/nvrm/disp.h
> index 06e972835d77..742b25a2a12d 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/nvrm/disp.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/nvrm/disp.h
> @@ -256,6 +256,8 @@ typedef struct NV0073_CTRL_DP_CTRL_PARAMS {
>      NvU32 eightLaneDpcdBaseAddr;
>  } NV0073_CTRL_DP_CTRL_PARAMS;
>  
> +#define NV0073_CTRL_CMD_DP_CONFIG_STREAM                  
> (0x731362U) /* finn: Evaluated from
> "(FINN_NV04_DISPLAY_COMMON_DP_INTERFACE_ID << 8) |
> NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS_MESSAGE_ID" */
> +
>  typedef struct NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS {
>      NvU32  subDeviceInstance;
>      NvU32  head;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
> index 0fb0e67406c6..e9ac47d86b69 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
> @@ -6,6 +6,7 @@
>  #ifndef __NVKM_RM_H__
>  #define __NVKM_RM_H__
>  #include "handles.h"
> +struct nvkm_ior;
>  struct nvkm_outp;
>  struct r535_gr;
>  
> @@ -93,6 +94,10 @@ struct nvkm_rm_api {
>  		struct {
>  			int (*get_caps)(struct nvkm_disp *, int
> *link_bw, bool *mst, bool *wm);
>  			int (*set_indexed_link_rates)(struct
> nvkm_outp *);
> +			int (*sst)(struct nvkm_ior *, int head, bool
> ef,
> +				   u32 watermark, u32 hblanksym, u32
> vblanksym);
> +			int (*vcpi)(struct nvkm_ior *, int head,
> +				    u8 slot, u8 slot_nr, u16 pbn,
> u16 aligned_pbn);
>  		} dp;
>  
>  		struct {


  reply	other threads:[~2026-08-21 22:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 16:49 [PATCH v2 00/10] nouveau: assorted display fixes (GB20x, r570 DP_CONFIG_STREAM, HF-EEODB EDIDs) Mohamed Ahmed
2026-08-20 16:49 ` [PATCH v2 01/10] drm/nouveau/disp: move GSP head-timing ISR and vblank helpers to tu102.c Mohamed Ahmed
2026-08-21 19:21   ` lyude
2026-08-21 21:31   ` lyude
2026-08-20 16:49 ` [PATCH v2 02/10] drm/nouveau/disp: move the GSP HDMI GCP AVMute write to engine/disp Mohamed Ahmed
2026-08-21 19:25   ` lyude
2026-08-20 16:49 ` [PATCH v2 03/10] drm/nouveau/disp: route GSP-RM display MMIO through nvkm_disp_func hooks Mohamed Ahmed
2026-08-21 21:30   ` lyude
2026-08-20 16:49 ` [PATCH v2 04/10] drm/nouveau/disp: fix HDMI vendor infoframes on GB20x Mohamed Ahmed
2026-08-21 21:52   ` lyude
2026-08-20 16:49 ` [PATCH v2 05/10] drm/nouveau/disp: fix HDMI GCP AVMute register offsets " Mohamed Ahmed
2026-08-21 21:59   ` lyude
2026-08-20 16:49 ` [PATCH v2 06/10] drm/nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware Mohamed Ahmed
2026-08-21 22:02   ` lyude [this message]
2026-08-20 16:49 ` [PATCH v2 07/10] drm/nouveau/disp: fix head state readback on GB20x Mohamed Ahmed
2026-08-21 22:06   ` lyude
2026-08-20 16:49 ` [PATCH v2 08/10] drm/nouveau/gsp: fix vblank interrupts " Mohamed Ahmed
2026-08-21 22:12   ` lyude
2026-08-21 22:36     ` Mohamed Ahmed
2026-08-20 16:49 ` [PATCH v2 09/10] drm/nouveau/dispnv50: program pixel clocks above 2.147GHz " Mohamed Ahmed
2026-08-21 22:16   ` lyude
2026-08-20 16:49 ` [PATCH v2 10/10] drm/nouveau: honor HF-EEODB EDIDs by converting to struct drm_edid Mohamed Ahmed
2026-08-21 22:19   ` lyude
2026-08-21 22:09 ` [PATCH v2 00/10] nouveau: assorted display fixes (GB20x, r570 DP_CONFIG_STREAM, HF-EEODB EDIDs) lyude

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=b91ad24281d52efd681f24e7f954f684104a84a7.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=airlied@gmail.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mary@mary.zone \
    --cc=mohamedahmedegypt2001@gmail.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®