[openchrome-devel] drm-openchrome: Branch 'drm-next-4.18' - 4 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Fri May 25 05:48:08 UTC 2018
drivers/gpu/drm/openchrome/Makefile | 1
drivers/gpu/drm/openchrome/openchrome_display.h | 8 -
drivers/gpu/drm/openchrome/openchrome_drv.h | 17 ++
drivers/gpu/drm/openchrome/openchrome_encoder.c | 173 ++++++++++++++++++++++++
4 files changed, 198 insertions(+), 1 deletion(-)
New commits:
commit ba8bab8be1c4bfdce9ac3495662ac2ca78f486ff
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu May 24 22:38:13 2018 -0700
drm/openchrome: Add openchrome_encoder.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/Makefile b/drivers/gpu/drm/openchrome/Makefile
index e44d044d47a3..18c64d4a8405 100644
--- a/drivers/gpu/drm/openchrome/Makefile
+++ b/drivers/gpu/drm/openchrome/Makefile
@@ -9,6 +9,7 @@ openchrome-y := openchrome_analog.o \
openchrome_crtc_hw.o \
openchrome_display.o \
openchrome_drv.o \
+ openchrome_encoder.o \
openchrome_fb.o \
openchrome_fence.o \
openchrome_fp.o \
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 5006854edb42..0c79a4fa9e81 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -364,4 +364,16 @@ extern struct ttm_tt* via_sgdma_backend_init(
struct ttm_buffer_object *bo,
uint32_t page_flags);
+void openchrome_transmitter_io_pad_state(struct via_device *dev_priv,
+ uint32_t di_port, bool io_pad_on);
+void openchrome_transmitter_clock_drive_strength(
+ struct via_device *dev_priv,
+ u32 di_port, u8 drive_strength);
+void openchrome_transmitter_data_drive_strength(
+ struct via_device *dev_priv,
+ u32 di_port, u8 drive_strength);
+void openchrome_transmitter_display_source(
+ struct via_device *dev_priv,
+ u32 di_port, int index);
+
#endif
diff --git a/drivers/gpu/drm/openchrome/openchrome_encoder.c b/drivers/gpu/drm/openchrome/openchrome_encoder.c
new file mode 100644
index 000000000000..22272f115492
--- /dev/null
+++ b/drivers/gpu/drm/openchrome/openchrome_encoder.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2017-2018 Kevin Brace. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+/*
+ * Author(s):
+ *
+ * Kevin Brace <kevinbrace at gmx.com>
+ *
+ */
+
+#include "openchrome_drv.h"
+
+
+void openchrome_transmitter_io_pad_state(struct via_device *dev_priv,
+ uint32_t di_port, bool io_pad_on)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_DVP0:
+ via_dvp0_set_io_pad_state(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case VIA_DI_PORT_DVP1:
+ via_dvp1_set_io_pad_state(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case VIA_DI_PORT_FPDPLOW:
+ via_fpdp_low_set_io_pad_state(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case VIA_DI_PORT_FPDPHIGH:
+ via_fpdp_high_set_io_pad_state(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case (VIA_DI_PORT_FPDPLOW |
+ VIA_DI_PORT_FPDPHIGH):
+ via_fpdp_low_set_io_pad_state(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ via_fpdp_high_set_io_pad_state(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case VIA_DI_PORT_LVDS1:
+ via_lvds1_set_io_pad_setting(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case VIA_DI_PORT_LVDS2:
+ via_lvds2_set_io_pad_setting(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ case (VIA_DI_PORT_LVDS1 |
+ VIA_DI_PORT_LVDS2):
+ via_lvds1_set_io_pad_setting(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ via_lvds2_set_io_pad_setting(VGABASE,
+ io_pad_on ? 0x03 : 0x00);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void openchrome_transmitter_clock_drive_strength(
+ struct via_device *dev_priv,
+ u32 di_port, u8 drive_strength)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_DVP0:
+ via_dvp0_set_clock_drive_strength(VGABASE,
+ drive_strength);
+ break;
+ case VIA_DI_PORT_DVP1:
+ via_dvp1_set_clock_drive_strength(VGABASE,
+ drive_strength);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void openchrome_transmitter_data_drive_strength(
+ struct via_device *dev_priv,
+ u32 di_port, u8 drive_strength)
+{
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_DVP0:
+ via_dvp0_set_data_drive_strength(VGABASE,
+ drive_strength);
+ break;
+ case VIA_DI_PORT_DVP1:
+ via_dvp1_set_data_drive_strength(VGABASE,
+ drive_strength);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+void openchrome_transmitter_display_source(
+ struct via_device *dev_priv,
+ u32 di_port, int index)
+{
+ u8 display_source = index & 0x01;
+
+ DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+ switch(di_port) {
+ case VIA_DI_PORT_DVP0:
+ via_dvp0_set_display_source(VGABASE, display_source);
+ break;
+ case VIA_DI_PORT_DVP1:
+ via_dvp1_set_display_source(VGABASE, display_source);
+ break;
+ case VIA_DI_PORT_FPDPLOW:
+ via_fpdp_low_set_display_source(VGABASE, display_source);
+ via_dvp1_set_display_source(VGABASE, display_source);
+ break;
+ case VIA_DI_PORT_FPDPHIGH:
+ via_fpdp_high_set_display_source(VGABASE, display_source);
+ via_dvp0_set_display_source(VGABASE, display_source);
+ break;
+ case (VIA_DI_PORT_FPDPLOW |
+ VIA_DI_PORT_FPDPHIGH):
+ via_fpdp_low_set_display_source(VGABASE, display_source);
+ via_fpdp_high_set_display_source(VGABASE, display_source);
+ break;
+ case VIA_DI_PORT_LVDS1:
+ via_lvds1_set_display_source(VGABASE, display_source);
+ break;
+ case VIA_DI_PORT_LVDS2:
+ via_lvds2_set_display_source(VGABASE, display_source);
+ break;
+ case (VIA_DI_PORT_LVDS1 |
+ VIA_DI_PORT_LVDS2):
+ via_lvds1_set_display_source(VGABASE, display_source);
+ via_lvds2_set_display_source(VGABASE, display_source);
+ break;
+ default:
+ break;
+ }
+
+ DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
commit 5b24b592958f8c2fe05b1885774485a0836f4293
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu May 24 10:53:21 2018 -0700
drm/openchrome: Add external DVI transmitter support to via_device struct
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index bfa7fbcdfa72..5006854edb42 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -223,6 +223,11 @@ struct via_device {
u32 int_tmds_di_port;
u32 int_tmds_i2c_bus;
+ bool ext_tmds_presence;
+ u32 ext_tmds_di_port;
+ u32 ext_tmds_i2c_bus;
+ u32 ext_tmds_transmitter;
+
bool int_fp1_presence;
u32 int_fp1_di_port;
u32 int_fp1_i2c_bus;
commit 7431f0d9a176a25547a4ea7757060c75a3c0d315
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu May 24 10:45:09 2018 -0700
drm/openchrome: Add i2c_bus information to via_encoder struct
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.h b/drivers/gpu/drm/openchrome/openchrome_display.h
index 18910c7691af..46cc9aa67f67 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.h
+++ b/drivers/gpu/drm/openchrome/openchrome_display.h
@@ -108,7 +108,7 @@ struct via_connector {
struct via_encoder {
struct drm_encoder base;
- uint32_t flags;
+ u32 i2c_bus;
u32 di_port;
struct via_connector cons[];
};
commit 4b64a518f83f7037a4dd381e39e606e33681e360
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu May 24 10:14:15 2018 -0700
drm/openchrome: Make via_i2c_(read / write)bytes externally referenceable
via_i2c_readbytes and via_i2c_writebytes need to be externally
referenceable.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.h b/drivers/gpu/drm/openchrome/openchrome_display.h
index fafa8e70e49c..18910c7691af 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.h
+++ b/drivers/gpu/drm/openchrome/openchrome_display.h
@@ -149,6 +149,12 @@ extern void via_modeset_fini(struct drm_device *dev);
/* i2c */
extern struct i2c_adapter *via_find_ddc_bus(int port);
+extern void via_i2c_readbytes(struct i2c_adapter *adapter,
+ u8 slave_addr, char offset,
+ u8 *buffer, unsigned int size);
+extern void via_i2c_writebytes(struct i2c_adapter *adapter,
+ u8 slave_addr, char offset,
+ u8 *data, unsigned int size);
extern int via_i2c_init(struct drm_device *dev);
extern void via_i2c_exit(void);
More information about the openchrome-devel
mailing list