[PATCH v2 4/9] drm/udl: Inline DPMS code into CRTC enable and disable functions
Emil Velikov
emil.l.velikov at gmail.com
Mon Dec 9 14:35:17 UTC 2019
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
Emil
More information about the dri-devel
mailing list