<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/drm_client_modeset.c, branch v6.6.150</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.150</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.150'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-08-14T11:58:53+00:00</updated>
<entry>
<title>drm/client: fix null pointer dereference in drm_client_modeset_probe</title>
<updated>2024-08-14T11:58:53+00:00</updated>
<author>
<name>Ma Ke</name>
<email>make24@iscas.ac.cn</email>
</author>
<published>2024-08-02T04:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d64fc94f7bb24fc2be0d6bd5df8df926da461a6d'/>
<id>urn:sha1:d64fc94f7bb24fc2be0d6bd5df8df926da461a6d</id>
<content type='text'>
commit 113fd6372a5bb3689aba8ef5b8a265ed1529a78f upstream.

In drm_client_modeset_probe(), the return value of drm_mode_duplicate() is
assigned to modeset-&gt;mode, which will lead to a possible NULL pointer
dereference on failure of drm_mode_duplicate(). Add a check to avoid npd.

Cc: stable@vger.kernel.org
Fixes: cf13909aee05 ("drm/fb-helper: Move out modeset config code")
Signed-off-by: Ma Ke &lt;make24@iscas.ac.cn&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240802044736.1570345-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/client: Fully protect modes[] with dev-&gt;mode_config.mutex</title>
<updated>2024-04-17T09:19:35+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2024-04-04T20:33:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=04e018bd913d3d3336ab7d21c2ad31a9175fe984'/>
<id>urn:sha1:04e018bd913d3d3336ab7d21c2ad31a9175fe984</id>
<content type='text'>
commit 3eadd887dbac1df8f25f701e5d404d1b90fd0fea upstream.

The modes[] array contains pointers to modes on the connectors'
mode lists, which are protected by dev-&gt;mode_config.mutex.
Thus we need to extend modes[] the same protection or by the
time we use it the elements may already be pointing to
freed/reused memory.

Cc: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10583
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240404203336.10454-2-ville.syrjala@linux.intel.com
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/client: Fix memory leak in drm_client_modeset_probe</title>
<updated>2023-07-13T13:55:58+00:00</updated>
<author>
<name>Jocelyn Falempe</name>
<email>jfalempe@redhat.com</email>
</author>
<published>2023-07-11T09:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2329cc7a101af1a844fbf706c0724c0baea38365'/>
<id>urn:sha1:2329cc7a101af1a844fbf706c0724c0baea38365</id>
<content type='text'>
When a new mode is set to modeset-&gt;mode, the previous mode should be freed.
This fixes the following kmemleak report:

drm_mode_duplicate+0x45/0x220 [drm]
drm_client_modeset_probe+0x944/0xf50 [drm]
__drm_fb_helper_initial_config_and_unlock+0xb4/0x2c0 [drm_kms_helper]
drm_fbdev_client_hotplug+0x2bc/0x4d0 [drm_kms_helper]
drm_client_register+0x169/0x240 [drm]
ast_pci_probe+0x142/0x190 [ast]
local_pci_probe+0xdc/0x180
work_for_cpu_fn+0x4e/0xa0
process_one_work+0x8b7/0x1540
worker_thread+0x70a/0xed0
kthread+0x29f/0x340
ret_from_fork+0x1f/0x30

cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Zhang Yi &lt;yizhan@redhat.com&gt;
Signed-off-by: Jocelyn Falempe &lt;jfalempe@redhat.com&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230711092203.68157-3-jfalempe@redhat.com
</content>
</entry>
<entry>
<title>drm/client: Fix memory leak in drm_client_target_cloned</title>
<updated>2023-07-13T13:54:54+00:00</updated>
<author>
<name>Jocelyn Falempe</name>
<email>jfalempe@redhat.com</email>
</author>
<published>2023-07-11T09:20:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c2a88e8bdf5f6239948d75283d0ae7e0c7945b03'/>
<id>urn:sha1:c2a88e8bdf5f6239948d75283d0ae7e0c7945b03</id>
<content type='text'>
dmt_mode is allocated and never freed in this function.
It was found with the ast driver, but most drivers using generic fbdev
setup are probably affected.

This fixes the following kmemleak report:
  backtrace:
    [&lt;00000000b391296d&gt;] drm_mode_duplicate+0x45/0x220 [drm]
    [&lt;00000000e45bb5b3&gt;] drm_client_target_cloned.constprop.0+0x27b/0x480 [drm]
    [&lt;00000000ed2d3a37&gt;] drm_client_modeset_probe+0x6bd/0xf50 [drm]
    [&lt;0000000010e5cc9d&gt;] __drm_fb_helper_initial_config_and_unlock+0xb4/0x2c0 [drm_kms_helper]
    [&lt;00000000909f82ca&gt;] drm_fbdev_client_hotplug+0x2bc/0x4d0 [drm_kms_helper]
    [&lt;00000000063a69aa&gt;] drm_client_register+0x169/0x240 [drm]
    [&lt;00000000a8c61525&gt;] ast_pci_probe+0x142/0x190 [ast]
    [&lt;00000000987f19bb&gt;] local_pci_probe+0xdc/0x180
    [&lt;000000004fca231b&gt;] work_for_cpu_fn+0x4e/0xa0
    [&lt;0000000000b85301&gt;] process_one_work+0x8b7/0x1540
    [&lt;000000003375b17c&gt;] worker_thread+0x70a/0xed0
    [&lt;00000000b0d43cd9&gt;] kthread+0x29f/0x340
    [&lt;000000008d770833&gt;] ret_from_fork+0x1f/0x30
unreferenced object 0xff11000333089a00 (size 128):

cc: &lt;stable@vger.kernel.org&gt;
Fixes: 1d42bbc8f7f9 ("drm/fbdev: fix cloning on fbcon")
Reported-by: Zhang Yi &lt;yizhan@redhat.com&gt;
Signed-off-by: Jocelyn Falempe &lt;jfalempe@redhat.com&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230711092203.68157-2-jfalempe@redhat.com
</content>
</entry>
<entry>
<title>drm/client: Remove match on mode name</title>
<updated>2022-11-24T11:42:40+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-11-17T09:28:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=65c7bcf773208ca85192d9c76e9f368269848c50'/>
<id>urn:sha1:65c7bcf773208ca85192d9c76e9f368269848c50</id>
<content type='text'>
Commit 3aeeb13d8996 ("drm/modes: Support modes names on the command
line") initially introduced the named modes support by essentially
matching the name passed on the command-line to the mode names defined
by the drivers.

This proved to be difficult to work with, since all drivers had to
provide properly named modes. This was also needed because we weren't
passing a full blown-mode to the drivers, but were only filling its
name.

Thanks to the previous patches, we now generate a proper mode, and we
thus can use the usual matching algo on timings, and can simply drop the
name match.

Reviewed-by: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Suggested-by: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Acked-in-principle-or-something-like-that-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-10-256dad125326@cerno.tech
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
</content>
</entry>
<entry>
<title>drm/client: Add some tests for drm_connector_pick_cmdline_mode()</title>
<updated>2022-11-15T09:08:37+00:00</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2022-11-14T13:00:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8fc0380f6ba7e9414c96a695a8c03e2ac31d1b0f'/>
<id>urn:sha1:8fc0380f6ba7e9414c96a695a8c03e2ac31d1b0f</id>
<content type='text'>
drm_connector_pick_cmdline_mode() is in charge of finding a proper
drm_display_mode from the definition we got in the video= command line
argument.

Let's add some unit tests to make sure we're not getting any regressions
there.

Acked-by: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Tested-by: Mateusz Kwiatkowski &lt;kfyatek+publicgit@gmail.com&gt;
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v9-8-24b168e5bcd5@cerno.tech
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
</content>
</entry>
<entry>
<title>drm: Drop drm_edid.h from drm_crtc.h</title>
<updated>2022-06-20T20:53:55+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2022-06-14T09:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=255490f9150da7c6dabe468f3a877b92fd0f02c1'/>
<id>urn:sha1:255490f9150da7c6dabe468f3a877b92fd0f02c1</id>
<content type='text'>
drm_crtc.h has no need for drm_edid.h, so don't include it.
Avoids useless rebuilds of the entire universe when
touching drm_edid.h.

Quite a few placs do currently depend on drm_edid.h without
actually including it directly. All of those need to be fixed
up.

v2: Fix up i915 and msm some more
v3: Fix alphabetical ordering (Sam)

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220614090245.30283-1-ville.syrjala@linux.intel.com
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>drm/client: Don't add new command-line mode</title>
<updated>2022-05-16T11:43:24+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2022-05-11T18:31:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0facdaa249c4e97346bc0b49c893e4a1d336b7dd'/>
<id>urn:sha1:0facdaa249c4e97346bc0b49c893e4a1d336b7dd</id>
<content type='text'>
Don't add a mode for the kernel's command-line parameters from
within the DRM client code. Doing so can result in an unusable
display. If there's no compatible command-line mode, the client
will use one of the connector's preferred modes.

All mode creation and validation has to be performed by the
connector. When clients run, the connector's fill_modes callback
has already processed the kernel parameters and validated each
mode before adding it. The connector's mode list does not contain
invalid modes.

v2:
	* grammar in commit message (Javier)

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220511183125.14294-4-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/client: Look for command-line modes first</title>
<updated>2022-05-16T11:43:21+00:00</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2022-05-11T18:31:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b959eb4f5b7ea49b47e95c9047d33d1b1cf81057'/>
<id>urn:sha1:b959eb4f5b7ea49b47e95c9047d33d1b1cf81057</id>
<content type='text'>
When picking a mode, first look for modes that have been specified
by the user on the kernel's command line. Only if that fails, use
the existing heuristic of picking a nearby mode from it's various
parameters.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220511183125.14294-3-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm: Convert open-coded yes/no strings to yesno()</title>
<updated>2022-02-07T21:04:25+00:00</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@intel.com</email>
</author>
<published>2022-01-26T09:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b8c75bd9746e3f1bdb5a1b6288b50dc2fdfec0ef'/>
<id>urn:sha1:b8c75bd9746e3f1bdb5a1b6288b50dc2fdfec0ef</id>
<content type='text'>
linux/string_helpers.h provides a helper to return "yes"/"no" strings.
Replace the open coded versions with str_yes_no(). The places were
identified with the following semantic patch:

	@@
	expression b;
	@@

	- b ? "yes" : "no"
	+ str_yes_no(b)

Then the includes were added, so we include-what-we-use, and parenthesis
adjusted in drivers/gpu/drm/v3d/v3d_debugfs.c. After the conversion we
still see the same binary sizes:

   text    data     bss     dec     hex filename
  51149    3295     212   54656    d580 virtio/virtio-gpu.ko.old
  51149    3295     212   54656    d580 virtio/virtio-gpu.ko
1441491   60340     800 1502631  16eda7 radeon/radeon.ko.old
1441491   60340     800 1502631  16eda7 radeon/radeon.ko
6125369  328538   34000 6487907  62ff63 amd/amdgpu/amdgpu.ko.old
6125369  328538   34000 6487907  62ff63 amd/amdgpu/amdgpu.ko
 411986   10490    6176  428652   68a6c drm.ko.old
 411986   10490    6176  428652   68a6c drm.ko
  98129    1636     264  100029   186bd dp/drm_dp_helper.ko.old
  98129    1636     264  100029   186bd dp/drm_dp_helper.ko
1973432  109640    2352 2085424  1fd230 nouveau/nouveau.ko.old
1973432  109640    2352 2085424  1fd230 nouveau/nouveau.ko

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@intel.com&gt;
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220126093951.1470898-10-lucas.demarchi@intel.com
</content>
</entry>
</feed>
