drivers/gpu/drm/via/crtc_hw.h    |   20 +++++++++++++++++
 drivers/gpu/drm/via/via_analog.c |   45 ++++++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/via/via_drv.h    |    4 +--
 3 files changed, 66 insertions(+), 3 deletions(-)

New commits:
commit ea3c88f5ce76f7e98952c4503b8170fb2d6d0472
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Thu Apr 6 17:21:54 2017 -0700

    Version bumped to 3.0.27
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 9a84b3312fe..4cd3b54d9a1 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -30,11 +30,11 @@
 #define DRIVER_AUTHOR       "The OpenChrome Project"
 #define DRIVER_NAME         "via"
 #define DRIVER_DESC         "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE         "20170404"
+#define DRIVER_DATE         "20170406"
 
 #define DRIVER_MAJOR           3
 #define DRIVER_MINOR           0
-#define DRIVER_PATCHLEVEL      26
+#define DRIVER_PATCHLEVEL      27
 
 #include <linux/module.h>
 
commit dea14e358c2ce1ce71e939488d9d0a2c14985069
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Thu Apr 6 17:20:05 2017 -0700

    Added via_analog_mode_set
    
    This function was added to via_analog.c.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/via/via_analog.c b/drivers/gpu/drm/via/via_analog.c
index e8113a41c01..02ea47c229b 100644
--- a/drivers/gpu/drm/via/via_analog.c
+++ b/drivers/gpu/drm/via/via_analog.c
@@ -115,10 +115,27 @@ via_dac_mode_fixup(struct drm_encoder *encoder,
        return true;
 }
 
+/*
+ * Handle analog (VGA) mode setting.
+ */
+static void
+via_analog_mode_set(struct drm_encoder *encoder,
+                    struct drm_display_mode *mode,
+                    struct drm_display_mode *adjusted_mode)
+{
+    struct via_device *dev_priv = encoder->dev->dev_private;
+
+    DRM_DEBUG_KMS("Entered via_analog_mode_set.\n");
+
+    viaAnalogSyncPolarity(dev_priv, adjusted_mode->flags);
+
+    DRM_DEBUG_KMS("Exiting via_analog_mode_set.\n");
+}
+
 static const struct drm_encoder_helper_funcs via_dac_enc_helper_funcs = {
        .dpms = via_analog_dpms,
        .mode_fixup = via_dac_mode_fixup,
-       .mode_set = via_set_sync_polarity,
+       .mode_set = via_analog_mode_set,
        .prepare = via_encoder_prepare,
        .commit = via_encoder_commit,
        .disable = via_encoder_disable,
commit 65d846e16b5fc58bcd565fed5d49e4ad12f79798
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Thu Apr 6 17:11:26 2017 -0700

    Added viaAnalogSyncPolarity
    
    This function was added to via_analog.c.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/via/via_analog.c b/drivers/gpu/drm/via/via_analog.c
index 47ae89766fa..e8113a41c01 100644
--- a/drivers/gpu/drm/via/via_analog.c
+++ b/drivers/gpu/drm/via/via_analog.c
@@ -41,6 +41,32 @@ viaAnalogOutput(struct via_device *dev_priv, bool 
outputState)
     DRM_DEBUG("Exiting viaAnalogOutput.\n");
 }
 
+/*
+ * Set analog (VGA) sync polarity.
+ */
+static void
+viaAnalogSyncPolarity(struct via_device *dev_priv, unsigned int flags)
+{
+    u8 syncPolarity = 0x00;
+
+    DRM_DEBUG_KMS("Entered viaAnalogSyncPolarity.\n");
+
+    if (flags & DRM_MODE_FLAG_NHSYNC) {
+        syncPolarity |= BIT(0);
+    }
+
+    if (flags & DRM_MODE_FLAG_NVSYNC) {
+        syncPolarity |= BIT(1);
+    }
+
+    viaAnalogSetSyncPolarity(VGABASE, syncPolarity);
+    DRM_INFO("Analog (VGA) Horizontal Sync Polarity: %s\n",
+                (syncPolarity & BIT(0)) ? "-" : "+");
+    DRM_INFO("Analog (VGA) Vertical Sync Polarity: %s\n",
+                (syncPolarity & BIT(1)) ? "-" : "+");
+
+    DRM_DEBUG_KMS("Exiting viaAnalogSyncPolarity.\n");
+}
 
 /*
  * Routines for controlling stuff on the analog port
commit 1b2657bcd1596611d1ae91dcb62d8e64444838f7
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Thu Apr 6 17:09:17 2017 -0700

    Added viaAnalogSetSyncPolarity
    
    This inline function was added to crtc_hw.h.
    
    Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/via/crtc_hw.h b/drivers/gpu/drm/via/crtc_hw.h
index adc737b2e71..702a2e0fcd2 100644
--- a/drivers/gpu/drm/via/crtc_hw.h
+++ b/drivers/gpu/drm/via/crtc_hw.h
@@ -101,6 +101,26 @@ viaAnalogSetDACOutput(void __iomem *regs, bool outputState)
 }
 
 /*
+ * Sets analog (VGA) sync polarity.
+ */
+static inline void
+viaAnalogSetSyncPolarity(void __iomem *regs, u8 syncPolarity)
+{
+    /* Set analog (VGA) sync polarity. */
+    /* 3C2[7] - Analog Vertical Sync Polarity
+     *          0: Positive
+     *          1: Negative
+     * 3C2[6] - Analog Horizontal Sync Polarity
+     *          0: Positive
+     *          1: Negative */
+    svga_wmisc_mask(regs, syncPolarity << 6, (BIT(1) | BIT(0)) << 6);
+    DRM_DEBUG_KMS("Analog (VGA) Horizontal Sync Polarity: %s\n",
+                (syncPolarity & BIT(0)) ? "-" : "+");
+    DRM_DEBUG_KMS("Analog (VGA) Vertical Sync Polarity: %s\n",
+                (syncPolarity & BIT(1)) ? "-" : "+");
+}
+
+/*
  * Sets CX700 or later single chipset's LVDS1 power sequence type.
  */
 static inline void
_______________________________________________
Openchrome-devel mailing list
Openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel

Reply via email to