From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hyun Kwon <hyunk@xilinx.com>
Cc: "monstr@monstr.eu" <monstr@monstr.eu>,
David Airlie <airlied@linux.ie>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Daniel Vetter <daniel.vetter@intel.com>,
Satish Kumar Nagireddy <SATISHNA@xilinx.com>,
Jeff Mouroux <jmouroux@xilinx.com>
Subject: Re: [PATCH 1/3] drm: drm_fourcc: Add scaling and padding factor to drm_format_info
Date: Wed, 13 Dec 2017 15:33:15 +0200 [thread overview]
Message-ID: <20171213133315.GU10981@intel.com> (raw)
In-Reply-To: <BY1PR0201MB10008FDC1F2040550D7343C1D6350@BY1PR0201MB1000.namprd02.prod.outlook.com>
On Wed, Dec 13, 2017 at 01:48:28AM +0000, Hyun Kwon wrote:
> Hi Laurent,
>
> Thanks for the comment.
>
> > -----Original Message-----
> > From: Laurent Pinchart [mailto:laurent.pinchart@ideasonboard.com]
> > Sent: Monday, December 11, 2017 6:02 AM
> > To: Hyun Kwon <hyunk@xilinx.com>
> > Cc: Daniel Vetter <daniel.vetter@intel.com>; Jani Nikula
> > <jani.nikula@linux.intel.com>; Sean Paul <seanpaul@chromium.org>; David
> > Airlie <airlied@linux.ie>; dri-devel@lists.freedesktop.org;
> > monstr@monstr.eu; Jeff Mouroux <jmouroux@xilinx.com>; Satish Kumar
> > Nagireddy <SATISHNA@xilinx.com>; Satish Kumar Nagireddy
> > <SATISHNA@xilinx.com>
> > Subject: Re: [PATCH 1/3] drm: drm_fourcc: Add scaling and padding factor
> > to drm_format_info
> >
> > Hi Hyun,
> >
> > Thank you for the patch.
> >
> > On Tuesday, 28 November 2017 04:27:31 EET Hyun Kwon wrote:
> > > From: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
> > >
> > > 'cpp_scale' can be used as a multiplying factor to calculate
> > > bytes per component based on color format.
> > > For eg. scaling factor of YUV420 8 bit format is 1
> > > so multiplying factor is 1 (8/8)
> > > scaling factor of YUV420 10 bit format is 1.25 (10/8)
> > >
> > > 'padding_scale' can be used as a multiplying factor to calculate
> > > actual width of video according to color format.
> > > For eg. padding factor of YUV420 8 bit format: 8 bits per 1 component
> > > no padding bits here, so multiplying factor is 1
> > > padding factor of YUV422 10 bit format: 32 bits per 3 components
> > > each component is 10 bit and the factor is 32/30
> > >
> > > Signed-off-by: Satish Kumar Nagireddy <satishna@xilinx.com>
> > > Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
> > > ---
> > > drivers/gpu/drm/drm_fourcc.c | 136 ++++++++++++++++++-----------------
> > -----
> > > include/drm/drm_fourcc.h | 9 +++
> > > 2 files changed, 77 insertions(+), 68 deletions(-)
> >
> > [snip]
> >
> > > diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
> > > index 6942e84..0202d19 100644
> > > --- a/include/drm/drm_fourcc.h
> > > +++ b/include/drm/drm_fourcc.h
> > > @@ -36,16 +36,25 @@ struct drm_mode_fb_cmd2;
> > > * use in new code and set to 0 for new formats.
> > > * @num_planes: Number of color planes (1 to 3)
> > > * @cpp: Number of bytes per pixel (per plane)
> > > + * @cpp_scale: { numerator, denominator }. Scaling factor for
> > > + * non 8bit aligned formats. For instance, { 10, 8 } can be used for
> > > + * 10 bit component / pixel formats.
> >
> > Stupid question, wouldn't it be better to replace cpp with a number of bits
> > per pixel then ? Or possibly supplement it if we need both. A scaling factor
> > seems difficult to use.
>
> Bits per pixel would work. I was hesitant to modify other drivers, but I can still make it that way.
>
> >
> > > * @hsub: Horizontal chroma subsampling factor
> > > * @vsub: Vertical chroma subsampling factor
> > > + * @padding_scale: { numerator, denominator }. Scaling factor for
> > > + * padding. This can be used for formats with padding bits after
> > > + * multiple pixels / components. For instance, if there are 2 bit
> > > + * padding after 3 10bit components, the value should be { 32, 30 }.
> >
> > Similarly, why don't you instead specify the number of padding bits directly ?
>
> I don't see how to model this with the number of padding bits. There can be arbitrary number of padding bits in every arbitrary number of components with arbitrary bpp. Just for example, 2 bits padding after 3 - 10bit components or 8 bit padding after 4 - 14bit components.
These formats seem to have quite a bit in common with the packed YUV
formats. So I'm thinking we probably want some kind of "bytes per
macropixel" thing, and something that tells us how many pixels are
in each macropixel.
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-12-13 13:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 2:27 [PATCH 0/3] Adding new drm formats needed by Xilinx IPs Hyun Kwon
2017-11-28 2:27 ` [PATCH 1/3] drm: drm_fourcc: Add scaling and padding factor to drm_format_info Hyun Kwon
2017-12-11 14:02 ` Laurent Pinchart
2017-12-13 1:48 ` Hyun Kwon
2017-12-13 13:33 ` Ville Syrjälä [this message]
2017-11-28 2:27 ` [PATCH 2/3] uapi: drm: New fourcc codes needed by Xilinx Video IP Hyun Kwon
2017-11-28 14:43 ` Ville Syrjälä
2017-11-28 17:25 ` Hyun Kwon
2017-11-28 18:11 ` Ville Syrjälä
2017-11-28 18:33 ` Hyun Kwon
2017-12-11 14:08 ` Laurent Pinchart
2017-12-11 14:24 ` Ville Syrjälä
2017-12-11 14:58 ` Laurent Pinchart
2017-11-28 2:27 ` [PATCH 3/3] drm: fourcc: Update DRM Framework with new fourcc codes Hyun Kwon
2017-11-28 11:09 ` [PATCH 0/3] Adding new drm formats needed by Xilinx IPs Daniel Vetter
2017-11-28 15:02 ` Emil Velikov
2017-11-28 17:26 ` Hyun Kwon
2017-11-28 17:38 ` Emil Velikov
2017-11-28 18:09 ` Hyun Kwon
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=20171213133315.GU10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=SATISHNA@xilinx.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hyunk@xilinx.com \
--cc=jmouroux@xilinx.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=monstr@monstr.eu \
/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.