<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/drm/drm_fourcc.h, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-01-18T18:00:18Z</updated>
<entry>
<title>drm/fourcc: Add format info helpers for checking YUV sub-sampling</title>
<updated>2019-01-18T18:00:18Z</updated>
<author>
<name>Paul Kocialkowski</name>
<email>paul.kocialkowski@bootlin.com</email>
</author>
<published>2019-01-18T14:51:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a211e56e947c8dbf37e1682f278bcfe8b20129c4'/>
<id>urn:sha1:a211e56e947c8dbf37e1682f278bcfe8b20129c4</id>
<content type='text'>
Display engine drivers often need to distinguish between different types of
YUV sub-sampling. This introduces helpers to check for common sub-sampling
ratios in their commonly-used denomination from the DRM format info.

Signed-off-by: Paul Kocialkowski &lt;paul.kocialkowski@bootlin.com&gt;
Reviewed-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190118145133.21281-3-paul.kocialkowski@bootlin.com
</content>
</entry>
<entry>
<title>drm/fourcc: Add format info helpers for checking YUV planes disposition</title>
<updated>2019-01-18T18:00:06Z</updated>
<author>
<name>Paul Kocialkowski</name>
<email>paul.kocialkowski@bootlin.com</email>
</author>
<published>2019-01-18T14:51:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=41c8c210a2b4ba8b1b532cdba7ff0112ef76abb2'/>
<id>urn:sha1:41c8c210a2b4ba8b1b532cdba7ff0112ef76abb2</id>
<content type='text'>
It is often useful to check whether the DRM format info retrieved from
the DRM framebuffer matches a specific YUV planes disposition.

This introduces helpers to quickly check that a provided format info
matches a YUV format with a specific disposition, in commonly-used
terminology.

The intent of providing helpers taking the format info instead of the
fourcc alone is to avoid the overhead of iterating through all formats
when the whole format info structure is available. As a result, these
helpers are very simple so they are made inline.

Signed-off-by: Paul Kocialkowski &lt;paul.kocialkowski@bootlin.com&gt;
Reviewed-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190118145133.21281-2-paul.kocialkowski@bootlin.com
</content>
</entry>
<entry>
<title>drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info</title>
<updated>2018-11-02T09:55:27Z</updated>
<author>
<name>Alexandru Gheorghe</name>
<email>alexandru-cosmin.gheorghe@arm.com</email>
</author>
<published>2018-11-01T17:02:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=042bf753842ddbddcf3d4c29f21a8905d6a33e79'/>
<id>urn:sha1:042bf753842ddbddcf3d4c29f21a8905d6a33e79</id>
<content type='text'>
For some pixel formats .cpp structure in drm_format info it's not
enough to describe the peculiarities of the pixel layout, for example
tiled formats or packed formats at bit level.

What's implemented here is to add three new members to drm_format_info
that could describe such formats:

- char_per_block[3]
- block_w[3]
- block_h[3]

char_per_block will be put in a union alongside cpp, for transparent
compatibility  with the existing format descriptions.

Regarding, block_w and block_h they are intended to be used through
their equivalent getters drm_format_info_block_width /
drm_format_info_block_height, the reason of the getters is to abstract
the fact that for normal formats block_w and block_h will be unset/0,
but the methods will be returning 1.

Additionally, convenience function drm_format_info_min_pitch had been
added that computes the minimum required pitch for a given pixel
format and buffer width.

Using that the following drm core functions had been updated to
generically handle both block and non-block formats:

- drm_fb_cma_get_gem_addr: for block formats it will just return the
  beginning of the block.
- framebuffer_check: Use the newly added drm_format_info_min_pitch.
- drm_gem_fb_create_with_funcs: Use the newly added
  drm_format_info_min_pitch.
- In places where is not expecting to handle block formats, like fbdev
  helpers I just added some warnings in case the block width/height
  are greater than 1.

Changes since v3:
 - Add helper function for computing the minimum required pitch.
 - Improve/cleanup documentation

Changes since v8:
 - Fixed build on 32bits arm architectures, with:

-       return DIV_ROUND_UP((u64)buffer_width * info-&gt;char_per_block[plane],
+       return DIV_ROUND_UP_ULL((u64)buffer_width * info-&gt;char_per_block[plane],

Reviewed-by: Brian Starkey &lt;brian.starkey@arm.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Alexandru Gheorghe &lt;alexandru-cosmin.gheorghe@arm.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20181101170055.5433-1-alexandru-cosmin.gheorghe@arm.com
</content>
</entry>
<entry>
<title>drm: fourcc: Convert drm_format_info kerneldoc to in-line member documentation</title>
<updated>2018-10-22T09:30:26Z</updated>
<author>
<name>Alexandru Gheorghe</name>
<email>alexandru-cosmin.gheorghe@arm.com</email>
</author>
<published>2018-10-19T10:57:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9c71a6686bfa4bd8404d1bfa8f210b9901991fa9'/>
<id>urn:sha1:9c71a6686bfa4bd8404d1bfa8f210b9901991fa9</id>
<content type='text'>
In-line member documentation seems to be desired way of documenting
structure members.

This change had been suggested by Daniel Vetter here:
https://lists.freedesktop.org/archives/dri-devel/2018-October/192176.html

Signed-off-by: Alexandru Gheorghe &lt;alexandru-cosmin.gheorghe@arm.com&gt;
Reviewed-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20181019105752.17741-2-alexandru-cosmin.gheorghe@arm.com
</content>
</entry>
<entry>
<title>drm: move native byte order quirk to new drm_driver_legacy_fb_format function</title>
<updated>2018-09-25T12:49:49Z</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-09-21T13:46:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=059b5eb5d9554dea689430ad3872dcb37a35053d'/>
<id>urn:sha1:059b5eb5d9554dea689430ad3872dcb37a35053d</id>
<content type='text'>
Turns out we need the pixel format fixup not only for the addfb ioctl,
but also for fbdev emulation code.

Ideally we would place it in drm_mode_legacy_fb_format().  That would
create alot of churn though, and most drivers don't care because they
never ever run on a big endian platform.  So add a new
drm_driver_legacy_fb_format() function instead which looks at the
mode_config-&gt;quirk_addfb_prefer_host_byte_order flag.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-2-kraxel@redhat.com
</content>
</entry>
<entry>
<title>drm: byteorder: add DRM_FORMAT_HOST_*</title>
<updated>2018-09-06T06:40:18Z</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-09-05T06:04:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ec2fae2558ba6b7b166db20901545cab7e41a050'/>
<id>urn:sha1:ec2fae2558ba6b7b166db20901545cab7e41a050</id>
<content type='text'>
Add fourcc variants in host byte order.  With these at hand we don't
need #ifdefs in drivers which support framebuffers in cpu endianess.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180905060445.15008-3-kraxel@redhat.com
</content>
</entry>
<entry>
<title>drm/fourcc: Add is_yuv field to drm_format_info to denote if the format is yuv</title>
<updated>2018-07-18T15:56:45Z</updated>
<author>
<name>Ayan Kumar Halder</name>
<email>ayan.halder@arm.com</email>
</author>
<published>2018-07-17T17:13:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ce2d54619a10780a0d354e10d4c83ae4fad46f41'/>
<id>urn:sha1:ce2d54619a10780a0d354e10d4c83ae4fad46f41</id>
<content type='text'>
A lot of drivers duplicate the function to check if a format is yuv or not.
If we add a field (to denote whether the format is yuv or not) in the
drm_format_info table, all the drivers can use this field and it will
prevent duplication of similar logic.

Signed-off-by: Ayan Kumar halder &lt;ayan.halder@arm.com&gt;
Reviewed-by: Ville Syrjala &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1531847626-22248-1-git-send-email-ayan.halder@arm.com
</content>
</entry>
<entry>
<title>drm/fourcc: Add a alpha field to drm_format_info</title>
<updated>2018-01-29T11:07:47Z</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime.ripard@free-electrons.com</email>
</author>
<published>2017-12-22T14:29:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4cc4e1b40f3ff5227c9f326542b75947b464a635'/>
<id>urn:sha1:4cc4e1b40f3ff5227c9f326542b75947b464a635</id>
<content type='text'>
There's a bunch of drivers that duplicate the same function to know if a
particular format embeds an alpha component or not.

Let's create a field in the drm_format_info to avoid duplicating that logic
and looking up formats all the time.

Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: Inki Dae &lt;inki.dae@samsung.com&gt;
Cc: Joonyoung Shim &lt;jy0922.shim@samsung.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Mark Yao &lt;mark.yao@rock-chips.com&gt;
Cc: Seung-Woo Kim &lt;sw0312.kim@samsung.com&gt;
Reviewed-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Signed-off-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/9cd9951d147ff810c1f6f68d79e7983361ed6b68.1516617243.git-series.maxime.ripard@free-electrons.com
</content>
</entry>
<entry>
<title>drm: Add mode_config .get_format_info() hook</title>
<updated>2017-03-22T17:45:00Z</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2017-03-21T18:12:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6a0f9ebfc5e753bb948c13353615324462d73795'/>
<id>urn:sha1:6a0f9ebfc5e753bb948c13353615324462d73795</id>
<content type='text'>
Allow drivers to return a custom drm_format_info structure for special
fb layouts. We'll use this for the compression control surface in i915.

v2: Fix drm_get_format_info() kernel doc (Laurent)
    Don't pass 'dev' to the new hook (Laurent)
v3: s/compresssion/compression/ (Ben)

Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Cc: Jason Ekstrand &lt;jason@jlekstrand.net&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Ben Widawsky &lt;ben@bwidawsk.net&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170321181218.10042-4-ville.syrjala@linux.intel.com
</content>
</entry>
<entry>
<title>drm: move allocation out of drm_get_format_name()</title>
<updated>2016-11-12T13:19:38Z</updated>
<author>
<name>Eric Engestrom</name>
<email>eric@engestrom.ch</email>
</author>
<published>2016-11-12T01:12:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b3c11ac267d461d3d597967164ff7278a919a39f'/>
<id>urn:sha1:b3c11ac267d461d3d597967164ff7278a919a39f</id>
<content type='text'>
The function's behaviour was changed in 90844f00049e, without changing
its signature, causing people to keep using it the old way without
realising they were now leaking memory.
Rob Clark also noticed it was also allocating GFP_KERNEL memory in
atomic contexts, breaking them.

Instead of having to allocate GFP_ATOMIC memory and fixing the callers
to make them cleanup the memory afterwards, let's change the function's
signature by having the caller take care of the memory and passing it to
the function.
The new parameter is a single-field struct in order to enforce the size
of its buffer and help callers to correctly manage their memory.

Fixes: 90844f00049e ("drm: make drm_get_format_name thread-safe")
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Rob Clark &lt;robdclark@gmail.com&gt;
Acked-by: Sinclair Yeh &lt;syeh@vmware.com&gt; (vmwgfx)
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Suggested-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Eric Engestrom &lt;eric@engestrom.ch&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20161112011309.9799-1-eric@engestrom.ch
</content>
</entry>
</feed>
