[PATCH v2 4/9] drm/udl: Inline DPMS code into CRTC enable and disable functions

Thomas Zimmermann tzimmermann at suse.de
Tue Dec 10 08:16:22 UTC 2019


Hi

Am 09.12.19 um 15:35 schrieb Emil Velikov:
> On Fri, 6 Dec 2019 at 12:47, Thomas Zimmermann <tzimmermann at suse.de> wrote:
>>
>> DPMS functionality is only used by the CRTC's enable and disable
>> functions. Inline the code.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
>> ---
>>  drivers/gpu/drm/udl/udl_modeset.c | 84 +++++++++++--------------------
>>  1 file changed, 30 insertions(+), 54 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
>> index 72884cbda131..4681446c2323 100644
>> --- a/drivers/gpu/drm/udl/udl_modeset.c
>> +++ b/drivers/gpu/drm/udl/udl_modeset.c
>> @@ -48,25 +48,9 @@ static char *udl_vidreg_unlock(char *buf)
>>   *  0x01 H and V sync off (screen blank but powered)
>>   *  0x07 DPMS powerdown (requires modeset to come back)
>>   */
>> -static char *udl_set_blank(char *buf, int dpms_mode)
>> +static char *udl_set_blank_mode(char *buf, u8 mode)
>>  {
>> -       u8 reg;
>> -       switch (dpms_mode) {
>> -       case DRM_MODE_DPMS_OFF:
>> -               reg = 0x07;
>> -               break;
>> -       case DRM_MODE_DPMS_STANDBY:
>> -               reg = 0x05;
>> -               break;
>> -       case DRM_MODE_DPMS_SUSPEND:
>> -               reg = 0x01;
>> -               break;
>> -       case DRM_MODE_DPMS_ON:
>> -               reg = 0x00;
>> -               break;
>> -       }
>> -
> As a follow-up, please add/use symbolic names for the the four states.
> Apart from the cosmetic aspect, this allows us to trivially change
> from DPMS_OFF to DPMS_SUSPEND or DPMS_STANDBY at any random point.
> 
> As-is the series is:
> Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

Thanks. The symbolic names are trivial to add here. I'll put them into
v3 of this patchset.

Best regards
Thomas

> 
> Thanks
> Emil
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20191210/9f1dbc07/attachment.sig>


More information about the dri-devel mailing list