Re: Re: Re: [PATCH v8 1/1] [DRIVER] gpu: drm: add support for YHGCH ZX1000 soc chipset
From: Chu Guangqing
Date: Tue Oct 14 2025 - 03:35:22 EST
Hi Jani,
> On Sat, 11 Oct 2025, Chu Guangqing <chuguangqing@xxxxxxxxxx> wrote:
>> Hi Jani,
>>
>>On Mon, 29 Sep 2025, Chu Guangqing <chuguangqing@xxxxxxxxxx> wrote:
>>>> diff --git a/drivers/gpu/drm/yhgch/yhgch_drm_vdac.c b/drivers/gpu/drm/yhgch/yhgch_drm_vdac.c
>>>> new file mode 100644
>>>> index 000000000000..2e222af29f69
>>>> --- /dev/null
>>>> +++ b/drivers/gpu/drm/yhgch/yhgch_drm_vdac.c
>>>> @@ -0,0 +1,134 @@
>>>> +// SPDX-License-Identifier: GPL-2.0
>>>> +
>>>> +#include <linux/io.h>
>>>> +
>>>> +#include <drm/drm_atomic_helper.h>
>>>> +#include <drm/drm_edid.h>
>>>> +#include <drm/drm_probe_helper.h>
>>>> +#include <drm/drm_print.h>
>>>> +#include <drm/drm_simple_kms_helper.h>
>>>> +
>>>> +#include "yhgch_drm_drv.h"
>>>> +#include "yhgch_drm_regs.h"
>>>> +
>>>> +static int yhgch_connector_get_modes(struct drm_connector *connector)
>>>> +{
>>>> + int count;
>>>> + const struct drm_edid *drm_edid;
>>>> +
>>>> + drm_edid = drm_edid_read(connector);
>>>> + if (drm_edid) {
>>>> + drm_edid_connector_update(connector, drm_edid);
>>>
>>>You're supposed to do drm_edid_connector_update() even for NULL edid to
>>>reset it.
>>>
>>>BR,
>>>Jani.
>>>
>>
>> I add an else here to make the call.
>
>Please follow the same/similar pattern as pretty much everyone else is
>doing:
>
> drm_edid = drm_edid_read(connector);
> drm_edid_connector_update(connector, drm_edid);
>
> if (drm_edid) {
> count = drm_edid_connector_add_modes(connector);
> drm_edid_free(drm_edid);
> }
>
>BR,
>Jani.
>
The changes have been made; please refer to the link below.
https://lore.kernel.org/all/20251014072421.4486-1-chuguangqing@xxxxxxxxxx/
>>
>>>> + count = drm_edid_connector_add_modes(connector);
>>>> + if (count)
>>>> + goto out;
>>>> + }
>>
>> - }
>> + } else
>> + drm_edid_connector_update(connector, NULL);
>>
>>>> +
>>>> + count = drm_add_modes_noedid(connector,
>>>> + connector->dev->mode_config.max_width,
>>>> + connector->dev->mode_config.max_height);
>>>> + drm_set_preferred_mode(connector, 1024, 768);
>>>> +
>>>> +out:
>>>> + drm_edid_free(drm_edid);
>>>> + return count;
>>>> +}
>>>
>>>--
>>>Jani Nikula, Intel
>>>
>>
>> Best regards
>>
>> Gary
>>
>
>--
>Jani Nikula, Intel
Best regards
Chu Guangqing