From: Jani Nikula <jani.nikula@intel.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
Melissa Wen <mwen@igalia.com>,
airlied@gmail.com, alexander.deucher@amd.com, alex.hung@amd.com,
christian.koenig@amd.com, daniel@ffwll.ch,
harry.wentland@amd.com, Rodrigo.Siqueira@amd.com,
sunpeng.li@amd.com, Xinhui.Pan@amd.com
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
kernel-dev@igalia.com
Subject: Re: [RFC PATCH 0/2] drm/amd/display: switch amdgpu_dm_connector to
Date: Mon, 29 Jan 2024 11:30:00 +0200 [thread overview]
Message-ID: <87o7d4jxlz.fsf@intel.com> (raw)
In-Reply-To: <5fdad82b-3f14-4bb4-9f49-b8397419204d@amd.com>
On Fri, 26 Jan 2024, Mario Limonciello <mario.limonciello@amd.com> wrote:
> On 1/26/2024 10:28, Melissa Wen wrote:
>> Hi,
>>
>> I'm debugging a null-pointer dereference when running
>> igt@kms_connector_force_edid and the way I found to solve the bug is to
>> stop using raw edid handler in amdgpu_connector_funcs_force and
>> create_eml_sink in favor of managing resouces via sruct drm_edid helpers
>> (Patch 1). The proper solution seems to be switch amdgpu_dm_connector
>> from struct edid to struct drm_edid and avoid the usage of different
>> approaches in the driver (Patch 2). However, doing it implies a good
>> amount of work and validation, therefore I decided to send this RFC
>> first to collect opinions and check if there is any parallel work on
>> this side. It's a working in progress.
>>
>> The null-pointer error trigger by the igt@kms_connector_force_edid test
>> was introduced by:
>> - e54ed41620f ("drm/amd/display: Remove unwanted drm edid references")
>>
>> You can check the error trace in the first patch.
>>
>> This series was tested with kms_hdmi_inject and kms_force_connector. No
>> null-pointer error, kms_hdmi_inject is successul and kms_force_connector
>> is sucessful after the second execution - the force-edid subtest
>> still fails in the first run (I'm still investigating).
>>
>> There is also a couple of cast warnings to be addressed - I'm looking
>> for the best replacement.
>>
>> I appreciate any feedback and testing.
>
> So I'm actually a little bit worried by hardcoding EDID_LENGTH in this
> series.
>
> I have some other patches that I'm posting later on that let you get the
> EDID from _DDC BIOS method too. My observation was that the EDID can be
> anywhere up to 512 bytes according to the ACPI spec.
>
> An earlier version of my patch was using EDID_LENGTH when fetching it
> and the EDID checksum failed.
>
> I'll CC you on the post, we probably want to get your changes and mine
> merged together.
One of the main points of struct drm_edid is that it tracks the
allocation size separately.
We should simply not trust edid->extensions, because most of the time it
originates from outside the kernel.
Using drm_edid and immediately drm_edid_raw() falls short. That function
should only be used during migration to help. And yeah, it also means
EDID parsing should be done in drm_edid.c, and not spread out all over
the subsystem.
BR,
Jani.
>
>>
>> Melissa
>>
>> Melissa Wen (2):
>> drm/amd/display: fix null-pointer dereference on edid reading
>> drm/amd/display: switch amdgpu_dm_connector to use struct drm_edid
>>
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 78 ++++++++++---------
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 4 +-
>> .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 9 ++-
>> .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 23 +++---
>> 4 files changed, 60 insertions(+), 54 deletions(-)
>>
>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-01-30 8:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 16:28 [RFC PATCH 0/2] drm/amd/display: switch amdgpu_dm_connector to Melissa Wen
2024-01-26 16:28 ` [RFC PATCH 1/2] drm/amd/display: fix null-pointer dereference on edid reading Melissa Wen
2024-01-29 14:18 ` kernel test robot
2024-01-26 16:28 ` [RFC PATCH 2/2] drm/amd/display: switch amdgpu_dm_connector to use struct drm_edid Melissa Wen
2024-01-26 19:33 ` Alex Hung
2024-02-05 14:33 ` Melissa Wen
2024-01-29 9:54 ` kernel test robot
2024-01-29 23:29 ` kernel test robot
2024-01-26 18:22 ` [RFC PATCH 0/2] drm/amd/display: switch amdgpu_dm_connector to Mario Limonciello
2024-01-29 9:30 ` Jani Nikula [this message]
2024-02-05 14:27 ` Melissa Wen
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=87o7d4jxlz.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=kernel-dev@igalia.com \
--cc=mario.limonciello@amd.com \
--cc=mwen@igalia.com \
--cc=sunpeng.li@amd.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.