All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Xinliang Liu <xinliang.liu@linaro.org>
To: Zhihui Chen <chenzhihui4@huawei.com>
Cc: chenzhihui244@msn.com, puck.chen@hisilicon.com,
	baowenyi@huawei.com, dri-devel@lists.freedesktop.org,
	kong.kongxinwei@hisilicon.com, zourongrong@gmail.com,
	allan.wang@siliconmotion.com
Subject: Re: [PATCH] drm/hisilicon/hibmc: add DPMS on/off function
Date: Thu, 13 Feb 2020 18:11:00 +0800	[thread overview]
Message-ID: <CAKoKPbzFTEK=kqeHE1AaJubP5XarEPQ0T4AUYpi3JtxLU5bV3w@mail.gmail.com> (raw)
In-Reply-To: <20191220023112.2728-1-chenzhihui4@huawei.com>


[-- Attachment #1.1: Type: text/plain, Size: 2967 bytes --]

On Fri, 20 Dec 2019 at 10:31, Zhihui Chen <chenzhihui4@huawei.com> wrote:

> add DPMS function to turn on/off signal of monitor
>
> Signed-off-by: Zhihui Chen <chenzhihui4@huawei.com>
>

Thanks for the patch.
Acked-by: Xinliang Liu <xinliang.liu@linaro.org>
Applied to drm-misc-next.


> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c   | 16 ++++++++++++++++
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h |  6 ++++++
>  2 files changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> index 722e369f30d4..24de937c1cb1 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
> @@ -189,6 +189,20 @@ static struct drm_plane *hibmc_plane_init(struct
> hibmc_drm_private *priv)
>         return plane;
>  }
>
> +static void hibmc_crtc_dpms(struct drm_crtc *crtc, int dpms)
> +{
> +       struct hibmc_drm_private *priv = crtc->dev->dev_private;
> +       unsigned int reg;
> +
> +       reg = readl(priv->mmio + HIBMC_CRT_DISP_CTL);
> +       reg &= ~HIBMC_CRT_DISP_CTL_DPMS_MASK;
> +       reg |= HIBMC_FIELD(HIBMC_CRT_DISP_CTL_DPMS, dpms);
> +       reg &= ~HIBMC_CRT_DISP_CTL_TIMING_MASK;
> +       if (dpms == HIBMC_CRT_DPMS_ON)
> +               reg |= HIBMC_CRT_DISP_CTL_TIMING(1);
> +       writel(reg, priv->mmio + HIBMC_CRT_DISP_CTL);
> +}
> +
>  static void hibmc_crtc_atomic_enable(struct drm_crtc *crtc,
>                                      struct drm_crtc_state *old_state)
>  {
> @@ -205,6 +219,7 @@ static void hibmc_crtc_atomic_enable(struct drm_crtc
> *crtc,
>         reg |= HIBMC_CURR_GATE_DISPLAY(1);
>         hibmc_set_current_gate(priv, reg);
>         drm_crtc_vblank_on(crtc);
> +       hibmc_crtc_dpms(crtc, HIBMC_CRT_DPMS_ON);
>  }
>
>  static void hibmc_crtc_atomic_disable(struct drm_crtc *crtc,
> @@ -213,6 +228,7 @@ static void hibmc_crtc_atomic_disable(struct drm_crtc
> *crtc,
>         unsigned int reg;
>         struct hibmc_drm_private *priv = crtc->dev->dev_private;
>
> +       hibmc_crtc_dpms(crtc, HIBMC_CRT_DPMS_OFF);
>         drm_crtc_vblank_off(crtc);
>
>         hibmc_set_power_mode(priv, HIBMC_PW_MODE_CTL_MODE_SLEEP);
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h
> b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h
> index b63a1ee15ceb..b9e20cfcfb5a 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_regs.h
> @@ -68,6 +68,12 @@
>
>  #define HIBMC_CRT_DISP_CTL                     0x80200
>
> +#define HIBMC_CRT_DISP_CTL_DPMS(x)             ((x) << 30)
> +#define HIBMC_CRT_DISP_CTL_DPMS_MASK           0xc0000000
> +
> +#define HIBMC_CRT_DPMS_ON                      0
> +#define HIBMC_CRT_DPMS_OFF                     3
> +
>  #define HIBMC_CRT_DISP_CTL_CRTSELECT(x)                ((x) << 25)
>  #define HIBMC_CRT_DISP_CTL_CRTSELECT_MASK      0x2000000
>
> --
> 2.20.1
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3986 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2020-02-13 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20  2:31 [PATCH] drm/hisilicon/hibmc: add DPMS on/off function Zhihui Chen
2020-02-13 10:11 ` Xinliang Liu [this message]

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='CAKoKPbzFTEK=kqeHE1AaJubP5XarEPQ0T4AUYpi3JtxLU5bV3w@mail.gmail.com' \
    --to=xinliang.liu@linaro.org \
    --cc=allan.wang@siliconmotion.com \
    --cc=baowenyi@huawei.com \
    --cc=chenzhihui244@msn.com \
    --cc=chenzhihui4@huawei.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=puck.chen@hisilicon.com \
    --cc=zourongrong@gmail.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.