All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Kandpal, Suraj" <suraj.kandpal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v9 6/7] drm/i915/vdsc: Check slice design requirement
Date: Tue, 21 Feb 2023 09:11:10 +0000	[thread overview]
Message-ID: <CY5PR11MB63441718E9F040CFCAFB5AFBF4A59@CY5PR11MB6344.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR11MB1741ED8C2E4BEC46BBD4FBB7E3A59@MWHPR11MB1741.namprd11.prod.outlook.com>



> -----Original Message-----
> From: Kandpal, Suraj <suraj.kandpal@intel.com>
> Sent: Tuesday, February 21, 2023 9:51 AM
> To: Shankar, Uma <uma.shankar@intel.com>; intel-gfx@lists.freedesktop.org
> Subject: RE: [Intel-gfx] [PATCH v9 6/7] drm/i915/vdsc: Check slice design
> requirement
> 
> > >
> > > +static int intel_dsc_slice_dimensions_valid(struct intel_crtc_state
> > *pipe_config,
> > > +					    struct drm_dsc_config *vdsc_cfg) {
> > > +	if (pipe_config->output_format == INTEL_OUTPUT_FORMAT_RGB ||
> > > +	    pipe_config->output_format ==
> > INTEL_OUTPUT_FORMAT_YCBCR444) {
> > > +		if (vdsc_cfg->slice_height > 4095)
> > > +			return -EINVAL;
> > > +		if (vdsc_cfg->slice_height * vdsc_cfg->slice_width >= 15000)
> >
> > This should be greater than 15000 for valid case, please check
> >
> > > +			return -EINVAL;
> > > +	} else if (pipe_config->output_format ==
> > > INTEL_OUTPUT_FORMAT_YCBCR420) {
> > > +		if (vdsc_cfg->slice_width % 2)
> > > +			return -EINVAL;
> > > +		if (vdsc_cfg->slice_height % 2)
> > > +			return -EINVAL;
> > > +		if (vdsc_cfg->slice_height > 4094)
> > > +			return -EINVAL;
> > > +		if (vdsc_cfg->slice_height * vdsc_cfg->slice_width >= 30000)
> >
> > This should be greater than 30000 for valid case, please check
> >
> 
> I missed this will fix it the condition should have been < 30000/15000
> 
> > > +			return -EINVAL;
> > > +	}
> > > +
> > > +	return 0;
> >
> > If code reaches here, format is 422 which should be EINVAL as of now.
> >
> 
> Not necessarily code can also reach here if all the slice dimension requirements are
> met for any format also AFAIK INTEL_OUTPUT_FORMAT_YCBCR422 has not been
> defined yet hence can be found in crtc_state->output_format

Oh yeah, missed that. But it would be good to have a check for YCBCR422 just to
restrict it here.

Regards,
Uma Shankar

> Regards,
> Suraj Kandpal
> 
> > > +}
> > > +
> > >  int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)  {
> > >  	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
> > > @@ -455,11 +478,20 @@ int intel_dsc_compute_params(struct
> > > intel_crtc_state
> > > *pipe_config)
> > >  	u16 compressed_bpp = pipe_config->dsc.compressed_bpp;
> > >  	const struct rc_parameters *rc_params;
> > >  	struct rc_parameters *rc = NULL;
> > > +	int err;
> > >  	u8 i = 0;
> > >
> > >  	vdsc_cfg->pic_width = pipe_config- hw.adjusted_mode.crtc_hdisplay;
> > >  	vdsc_cfg->slice_width = DIV_ROUND_UP(vdsc_cfg->pic_width,
> > >  					     pipe_config->dsc.slice_count);
> > > +
> > > +	err = intel_dsc_slice_dimensions_valid(pipe_config, vdsc_cfg);
> > > +
> > > +	if (err) {
> > > +		drm_dbg_kms(&dev_priv->drm, "Slice dimension
> > requirements not
> > > met\n");
> > > +		return err;
> > > +	}
> > > +
> > >  	/*
> > >  	 * According to DSC 1.2 specs if colorspace is YCbCr then
> > > convert_rgb
> > is 0
> > >  	 * else 1
> > > --
> > > 2.25.1


  reply	other threads:[~2023-02-21  9:11 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  7:44 [Intel-gfx] [PATCH v9 0/7] Enable YCbCr420 for VDSC Suraj Kandpal
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 1/7] drm/dp_helper: Add helper to check if the sink supports given format with DSC Suraj Kandpal
2023-02-20 20:37   ` Shankar, Uma
2023-02-20 20:50     ` Shankar, Uma
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 2/7] drm/i915/dp: Check if DSC supports the given output_format Suraj Kandpal
2023-02-20 20:49   ` Shankar, Uma
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 3/7] drm/i915: Adding the new registers for DSC Suraj Kandpal
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 4/7] drm/i915: Enable YCbCr420 for VDSC Suraj Kandpal
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 5/7] drm/i915: Fill in native_420 field Suraj Kandpal
2023-02-14 11:50   ` Jani Nikula
2023-02-15  3:02     ` Kandpal, Suraj
2023-02-15  3:17   ` [Intel-gfx] [PATCH v10 " Suraj Kandpal
2023-02-20 21:37     ` Shankar, Uma
2023-02-21  4:40       ` Kandpal, Suraj
2023-02-21  9:15         ` Shankar, Uma
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 6/7] drm/i915/vdsc: Check slice design requirement Suraj Kandpal
2023-02-20 21:53   ` Shankar, Uma
2023-02-21  4:20     ` Kandpal, Suraj
2023-02-21  9:11       ` Shankar, Uma [this message]
2023-02-07  7:44 ` [Intel-gfx] [PATCH v9 7/7] drm/i915/dsc: Add debugfs entry to validate DSC output formats Suraj Kandpal
2023-02-07  8:35   ` Jani Nikula
2023-02-08 14:16     ` Swati Sharma
2023-02-10 11:31       ` Jani Nikula
2023-02-14 10:51   ` [Intel-gfx] [v10] " Swati Sharma
2023-02-14 10:51     ` Jani Nikula
2023-02-14 11:01       ` Swati Sharma
2023-02-14 11:02   ` [Intel-gfx] [v11] " Swati Sharma
2023-02-20 21:57     ` Shankar, Uma
2023-02-07  8:09 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Enable YCbCr420 for VDSC Patchwork
2023-02-07  8:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-07 13:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-14 14:51 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Enable YCbCr420 for VDSC (rev3) Patchwork
2023-02-14 15:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-15  3:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-15  3:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Enable YCbCr420 for VDSC (rev4) Patchwork
2023-02-15  4:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-15 15:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=CY5PR11MB63441718E9F040CFCAFB5AFBF4A59@CY5PR11MB6344.namprd11.prod.outlook.com \
    --to=uma.shankar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=suraj.kandpal@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.