<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/drm/drm_fourcc.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-07-16T17:01:13+00:00</updated>
<entry>
<title>drm: Pass pixel_format+modifier directly to drm_get_format_info()</title>
<updated>2025-07-16T17:01:13+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2025-07-01T09:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0e7d5874fb6b80c44be3cfbcf1cf356e81d91232'/>
<id>urn:sha1:0e7d5874fb6b80c44be3cfbcf1cf356e81d91232</id>
<content type='text'>
Decouple drm_get_format_info() from struct drm_mode_fb_cmd2 and just
pass the pixel format+modifier combo in by hand.

We may want to use drm_get_format_info() outside of the normal
addfb paths where we won't have a struct drm_mode_fb_cmd2, and
creating a temporary one just for this seems silly.

Done with cocci:
@@
identifier dev, mode_cmd;
@@
struct drm_format_info *
drm_get_format_info(struct drm_device *dev,
-		    const struct drm_mode_fb_cmd2 *mode_cmd
+		    u32 pixel_format, u64 modifier
     		    )
{
&lt;...
(
- mode_cmd-&gt;pixel_format
+ pixel_format
|
- mode_cmd-&gt;modifier[0]
+ modifier
)
...&gt;
}

@@
identifier dev, mode_cmd;
@@
struct drm_format_info *
drm_get_format_info(struct drm_device *dev,
-		    const struct drm_mode_fb_cmd2 *mode_cmd
+		    u32 pixel_format, u64 modifier
     		    );

@@
expression dev, mode_cmd;
@@
- drm_get_format_info(dev, mode_cmd)
+ drm_get_format_info(dev, mode_cmd-&gt;pixel_format, mode_cmd-&gt;modifier[0])

v2: Fix kernel docs (Laurent)
    Drop drm_mode_fb_cmd2 forward declaration (Thomas)

Cc: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Inki Dae &lt;inki.dae@samsung.com&gt;
Cc: Seung-Woo Kim &lt;sw0312.kim@samsung.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Cc: Patrik Jakobsson &lt;patrik.r.jakobsson@gmail.com&gt;
Cc: Chun-Kuang Hu &lt;chunkuang.hu@kernel.org&gt;
Cc: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Abhinav Kumar &lt;quic_abhinavk@quicinc.com&gt;
Cc: Dmitry Baryshkov &lt;lumag@kernel.org&gt;
Cc: Sean Paul &lt;sean@poorly.run&gt;
Cc: Marijn Suijten &lt;marijn.suijten@somainline.org&gt;
Cc: Marek Vasut &lt;marex@denx.de&gt;
Cc: Stefan Agner &lt;stefan@agner.ch&gt;
Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: Danilo Krummrich &lt;dakr@kernel.org&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Cc: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Cc: Sandy Huang &lt;hjc@rock-chips.com&gt;
Cc: "Heiko Stübner" &lt;heiko@sntech.de&gt;
Cc: Andy Yan &lt;andy.yan@rock-chips.com&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: Mikko Perttunen &lt;mperttunen@nvidia.com&gt;
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Reviewed-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250701090722.13645-3-ville.syrjala@linux.intel.com
</content>
</entry>
<entry>
<title>drm/fbdev-helper: Move color-mode lookup into 4CC format helper</title>
<updated>2024-09-26T06:27:49+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2024-09-24T07:11:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb1f4adf9101573fc2347978a60d71c4f1176cca'/>
<id>urn:sha1:eb1f4adf9101573fc2347978a60d71c4f1176cca</id>
<content type='text'>
The color mode as specified on the kernel command line gives the user's
preferred color depth and number of bits per pixel. Move the
color-mode-to-format conversion from fbdev helpers into a 4CC helper,
so that it can be shared among DRM clients.

v2:
- fix grammar in commit message (Laurent)

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-2-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm: Remove plane hsub/vsub alignment requirement for core helpers</title>
<updated>2023-10-12T07:51:19+00:00</updated>
<author>
<name>Carlos Eduardo Gallo Filho</name>
<email>gcarlos@disroot.org</email>
</author>
<published>2023-09-26T14:15:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f2f455981a34ce8ca88a41458c09494b387d344f'/>
<id>urn:sha1:f2f455981a34ce8ca88a41458c09494b387d344f</id>
<content type='text'>
The drm_format_info_plane_{height,width} functions was implemented using
regular division for the plane size calculation, which cause issues [1][2]
when used on contexts where the dimensions are misaligned with relation
to the subsampling factors. So, replace the regular division by the
DIV_ROUND_UP macro.

This allows these functions to be used in more drivers, making further
work to bring more core presence on them possible.

[1] http://patchwork.freedesktop.org/patch/msgid/20170321181218.10042-3-ville.syrjala@linux.intel.com
[2] https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-2-imre.deak@intel.com

Signed-off-by: Carlos Eduardo Gallo Filho &lt;gcarlos@disroot.org&gt;
Reviewed-by: André Almeida &lt;andrealmeid@igalia.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230926141519.9315-2-gcarlos@disroot.org
</content>
</entry>
<entry>
<title>drm/fourcc: Add drm_format_info.is_color_indexed flag</title>
<updated>2022-07-09T13:00:08+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2022-07-08T18:20:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dc1dc76bd9a48c6aba3efae5eadb9a884043966e'/>
<id>urn:sha1:dc1dc76bd9a48c6aba3efae5eadb9a884043966e</id>
<content type='text'>
Add a flag to struct drm_format_info to indicate if a format is
color-indexed, similar to the existing .is_yuv flag.

This way generic code and drivers can just check this flag, instead of
checking against a list of fourcc formats.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/90cd390b2b4d481661f966de7b504f1702d80dfd.1657294931.git.geert@linux-m68k.org
</content>
</entry>
<entry>
<title>drm/fourcc: Add drm_format_info_bpp() helper</title>
<updated>2022-07-09T12:59:22+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2022-07-08T18:20:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96dc635d5538055cb6ccd7b6e9290dfcfc385f97'/>
<id>urn:sha1:96dc635d5538055cb6ccd7b6e9290dfcfc385f97</id>
<content type='text'>
Add a helper to retrieve the actual number of bits per pixel for a
plane, taking into account the number of characters and pixels per
block for tiled formats.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1cae5ebc28513ec1c91c66b00647ce3ca23bfba7.1657294931.git.geert@linux-m68k.org
</content>
</entry>
<entry>
<title>drm: Define DRM_FORMAT_MAX_PLANES</title>
<updated>2021-08-02T14:41:20+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2021-07-30T18:35:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=279cc2e9543eb357c0ef299cf398b2e74a021f6b'/>
<id>urn:sha1:279cc2e9543eb357c0ef299cf398b2e74a021f6b</id>
<content type='text'>
DRM uses a magic number of 4 for the maximum number of planes per color
format. Declare this constant via DRM_FORMAT_MAX_PLANES and update the
related code. Some code depends on the length of arrays that are now
declared with DRM_FORMAT_MAX_PLANES. Convert it from '4' to ARRAY_SIZE.

v2:
	* mention usage of ARRAY_SIZE() in the commit message (Maxime)
	* also fix error handling in drm_gem_fb_init_with_funcs()
	  (kernel test robot)
	* include &lt;drm/drm_fourcc.h&gt; for DRM_FORMAT_MAX_PLANES

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210730183511.20080-2-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/fourcc: Remove struct drm_format_buf_name</title>
<updated>2021-05-27T06:34:57+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2021-05-16T12:13:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4eaba3853ede40965f2ed379223ca2202550c73'/>
<id>urn:sha1:c4eaba3853ede40965f2ed379223ca2202550c73</id>
<content type='text'>
The structure is unused. Remove it.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210516121315.30321-5-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm: Remove drm_get_format_name()</title>
<updated>2021-05-27T06:34:50+00:00</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@linux.intel.com</email>
</author>
<published>2021-05-16T12:13:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b066c72e6a1c2a4876a0ad1032b1fef6fc86e6eb'/>
<id>urn:sha1:b066c72e6a1c2a4876a0ad1032b1fef6fc86e6eb</id>
<content type='text'>
The %p4cc printk format modifier was recently added to print fourcc codes,
replacing drm_get_format_name(). The function is no longer needed, so
remove it.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210516121315.30321-4-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/fb: Extend format_info member arrays to handle four planes</title>
<updated>2020-01-07T11:16:08+00:00</updated>
<author>
<name>Dhinakaran Pandiyan</name>
<email>dhinakaran.pandiyan@intel.com</email>
</author>
<published>2019-10-28T20:40:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a7007efa673cf07dc374ad6cf85ae8e65ee1337f'/>
<id>urn:sha1:a7007efa673cf07dc374ad6cf85ae8e65ee1337f</id>
<content type='text'>
addfb() uAPI has supported four planes for a while now, make format_info
compatible with that.

Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: Matt Roper &lt;matthew.d.roper@intel.com&gt;
Cc: Mika Kahola &lt;mika.kahola@intel.com&gt;
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dhinakaran Pandiyan &lt;dhinakaran.pandiyan@intel.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Reviewed-by: Mika Kahola &lt;mika.kahola@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191231233756.18753-7-imre.deak@intel.com
</content>
</entry>
<entry>
<title>drm/fourcc: Fix the parameters name in the documentation</title>
<updated>2019-05-21T14:58:05+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime.ripard@bootlin.com</email>
</author>
<published>2019-05-21T11:09:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7793a108964924dd2802ee8c5dff2e9f3a9cd54a'/>
<id>urn:sha1:7793a108964924dd2802ee8c5dff2e9f3a9cd54a</id>
<content type='text'>
We introduced new functions in the commit bf39607c1614 ("drm/fourcc: Pass
the format_info pointer to drm_format_plane_width/height") based on
previous ones but with a slightly different prototype. However, the
documentation wasn't changed to reflect that change.

Fixes: bf39607c1614 ("drm/fourcc: Pass the format_info pointer to drm_format_plane_width/height")
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Maxime Ripard &lt;maxime.ripard@bootlin.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190521110906.15268-1-maxime.ripard@bootlin.com
</content>
</entry>
</feed>
