[PATCH] drm/hisilicon: Set preferred mode resolution and maximum resolution

Xinliang Liu xinliang.liu at linaro.org
Tue Feb 25 03:01:21 UTC 2020


On Tue, 25 Feb 2020 at 10:19, Xinliang Liu <xinliang.liu at linaro.org> wrote:

>
>
> On Wed, 19 Feb 2020 at 10:52, Tian Tao <tiantao6 at hisilicon.com> wrote:
>
>> set the preferred mode resolution to 1024 * 768 and maximum
>> resolution to 1920 * 1200.
>>
>> Signed-off-by: Tian Tao <tiantao6 at hisilicon.com>
>> Signed-off-by: Gong junjie <gongjunjie2 at huawei.com>
>> ---
>>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> index 6d98fdc..82fc7d3 100644
>> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
>> @@ -11,8 +11,10 @@
>>   *     Jianhua Li <lijianhua at huawei.com>
>>   */
>>
>> +#include <drm/drm_gem_vram_helper.h>
>>  #include <drm/drm_atomic_helper.h>
>>  #include <drm/drm_probe_helper.h>
>> +#include <drm/drm_crtc_helper.h>
>>  #include <drm/drm_print.h>
>>
>>  #include "hibmc_drm_drv.h"
>> @@ -20,7 +22,13 @@
>>
>>  static int hibmc_connector_get_modes(struct drm_connector *connector)
>>  {
>> -       return drm_add_modes_noedid(connector, 800, 600);
>> +       int count;
>> +
>> +       drm_connector_update_edid_property(connector, NULL);
>>
>
And as there is no edid for the connector, don't think call
drm_connector_update_edid_property is required.


> +       count = drm_add_modes_noedid(connector, 1920, 1200);
>>
>
> Hi Tao, maybe it's better like this:
> count = drm_add_modes_noedid( connector ,
>                                       conn->dev->mode_config.max_width,
>                                       conn->dev->mode_config.max_height);
>
>
>> +       drm_set_preferred_mode(connector, 1024, 768);
>> +
>> +       return count;
>>  }
>>
>>  static enum drm_mode_status hibmc_connector_mode_valid(struct
>> drm_connector *connector,
>> --
>> 2.7.4
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200225/40990f85/attachment-0001.htm>


More information about the dri-devel mailing list