linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Steiger <mathias.steiger@googlemail.com>
To: linux-amlogic@lists.infradead.org
Subject: [PATCH] fix green/pink color distortion from HDR set during vendor Uboot
Date: Mon, 19 Apr 2021 16:33:39 +0200	[thread overview]
Message-ID: <50fb92c7-28f2-f3c8-7986-425cdac77c78@gmail.com> (raw)


I also wrote a program to set this via /dev/mem from user space: 
https://github.com/ballerburg9005/android-tvbox-2-linux-pc-and-server/blob/main/fix_greenpink.c 
.



diff --git a/drivers/gpu/drm/meson/meson_drv.c 
b/drivers/gpu/drm/meson/meson_drv.c
index 453d8b4c5..7d929b5b2 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -308,6 +308,10 @@ static int meson_drv_bind_master(struct device 
*dev, bool has_components)
         drm->mode_config.funcs = &meson_mode_config_funcs;
         drm->mode_config.helper_private = &meson_mode_config_helpers;

+       /* undo settings made in vendor Uboot */
+
+       writel_bits_relaxed(15 << 13, 0, priv->io_base + 
_REG(OSD1_HDR2_CTRL)); // fixes green/pink color distortion - 
reg_only_mat must be 0
+
         /* Hardware Initialization */

         meson_vpu_init(priv);
diff --git a/drivers/gpu/drm/meson/meson_registers.h 
b/drivers/gpu/drm/meson/meson_registers.h
index 446e7961d..91351f9a3 100644
--- a/drivers/gpu/drm/meson/meson_registers.h
+++ b/drivers/gpu/drm/meson/meson_registers.h
@@ -634,6 +634,9 @@
  #define VPP_WRAP_OSD3_MATRIX_PRE_OFFSET2 0x3dbc
  #define VPP_WRAP_OSD3_MATRIX_EN_CTRL 0x3dbd

+/* osd1 HDR */
+#define OSD1_HDR2_CTRL 0x38a0
+
  /* osd2 scaler */
  #define OSD2_VSC_PHASE_STEP 0x3d00
  #define OSD2_VSC_INI_PHASE 0x3d01


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

             reply	other threads:[~2021-04-19 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 14:33 Mathias Steiger [this message]
2021-04-19 14:50 ` [PATCH] fix green/pink color distortion from HDR set during vendor Uboot Neil Armstrong
2021-04-20 13:01   ` Neil Armstrong
2021-04-26 18:01     ` Neil Armstrong

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=50fb92c7-28f2-f3c8-7986-425cdac77c78@gmail.com \
    --to=mathias.steiger@googlemail.com \
    --cc=linux-amlogic@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).