[openchrome-devel] drm-openchrome: Branch 'drm-next-5.17' - 7 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Fri Jan 21 23:49:47 UTC 2022
drivers/gpu/drm/openchrome/openchrome_crtc_hw.h | 4
drivers/gpu/drm/openchrome/openchrome_display.c | 152 ------------------------
drivers/gpu/drm/openchrome/openchrome_drv.h | 74 +++++------
drivers/gpu/drm/openchrome/openchrome_hdmi.c | 2
drivers/gpu/drm/openchrome/openchrome_i2c.c | 10 +
5 files changed, 49 insertions(+), 193 deletions(-)
New commits:
commit 754ff111cefa893bf1cf5c8a95d01d93304291b9
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:42:23 2022 -0600
drm/openchrome: Version bumped to 3.4.14
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 e83fe737fffd..59102310051e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -60,10 +60,10 @@
#define DRIVER_MAJOR 3
#define DRIVER_MINOR 4
-#define DRIVER_PATCHLEVEL 13
+#define DRIVER_PATCHLEVEL 14
#define DRIVER_NAME "openchrome"
#define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20220114"
+#define DRIVER_DATE "20220121"
#define DRIVER_AUTHOR "OpenChrome Project"
commit 154e213f070d3014149c7f476b8dd3e56de4c0cd
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:38:03 2022 -0600
drm/openchrome: Remove via_init_td_timing_regs()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 298cd0f6a680..7309881dffe5 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -121,37 +121,6 @@ via_init_td_timing_regs(struct drm_device *dev)
}
}
-static void
-via_display_init(struct drm_device *dev)
-{
- struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private = dev->dev_private;
- u8 index = 0x3D, value;
-
- /* Check if spread spectrum is enabled */
- if (pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA)
- index = 0x2C;
-
- value = vga_rseq(VGABASE, 0x1E);
- if (value & BIT(3)) {
- value = vga_rseq(VGABASE, index);
- vga_wseq(VGABASE, index, value & 0xFE);
-
- value = vga_rseq(VGABASE, 0x1E);
- vga_wseq(VGABASE, 0x1E, value & 0xF7);
-
- dev_private->spread_spectrum = true;
- } else
- dev_private->spread_spectrum = false;
-
- /* Init TD timing register (power sequence) */
- via_init_td_timing_regs(dev);
-
- /* I/O address bit to be 1. Enable access */
- /* to frame buffer at A0000-BFFFFh */
- svga_wmisc_mask(VGABASE, BIT(0), BIT(0));
-}
-
int
via_modeset_init(struct drm_device *dev)
{
@@ -166,7 +135,8 @@ via_modeset_init(struct drm_device *dev)
dev_private->number_fp = 0;
dev_private->number_dvi = 0;
- via_display_init(dev);
+ /* Init TD timing register (power sequence) */
+ via_init_td_timing_regs(dev);
via_i2c_reg_init(dev_private);
ret = via_i2c_init(dev);
commit feb32a29ae0e2834b2d08a58de0910dbcebc6141
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:38:01 2022 -0600
drm/openchrome: Remove via_init_crtc_regs()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index dd0af1922a58..298cd0f6a680 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -121,45 +121,6 @@ via_init_td_timing_regs(struct drm_device *dev)
}
}
-static void
-via_init_crtc_regs(struct drm_device *dev)
-{
- struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct openchrome_drm_private *dev_private = dev->dev_private;
-
- via_unlock_crtc(VGABASE, pdev->device);
-
- /* always set to 1 */
- svga_wcrt_mask(VGABASE, 0x03, BIT(7), BIT(7));
- /* bits 0 to 7 of line compare */
- vga_wcrt(VGABASE, 0x18, 0xFF);
- /* bit 8 of line compare */
- svga_wcrt_mask(VGABASE, 0x07, BIT(4), BIT(4));
- /* bit 9 of line compare */
- svga_wcrt_mask(VGABASE, 0x09, BIT(6), BIT(6));
- /* bit 10 of line compare */
- svga_wcrt_mask(VGABASE, 0x35, BIT(4), BIT(4));
- /* adjust hsync by one character - value 011 */
- svga_wcrt_mask(VGABASE, 0x33, 0x06, 0x07);
- /* extend mode always set to e3h */
- vga_wcrt(VGABASE, 0x17, 0xE3);
- /* extend mode always set to 0h */
- vga_wcrt(VGABASE, 0x08, 0x00);
- /* extend mode always set to 0h */
- vga_wcrt(VGABASE, 0x14, 0x00);
-
- /* If K8M800, enable Prefetch Mode. */
- if ((pdev->device == PCI_DEVICE_ID_VIA_K8M800) ||
- (pdev->device == PCI_DEVICE_ID_VIA_K8M890))
- svga_wcrt_mask(VGABASE, 0x33, 0x00, BIT(3));
-
- if ((pdev->device == PCI_DEVICE_ID_VIA_CLE266) &&
- (dev_private->revision == CLE266_REVISION_AX))
- svga_wseq_mask(VGABASE, 0x1A, BIT(1), BIT(1));
-
- via_lock_crtc(VGABASE);
-}
-
static void
via_display_init(struct drm_device *dev)
{
@@ -183,9 +144,6 @@ via_display_init(struct drm_device *dev)
} else
dev_private->spread_spectrum = false;
- /* Load fixed CRTC timing registers */
- via_init_crtc_regs(dev);
-
/* Init TD timing register (power sequence) */
via_init_td_timing_regs(dev);
commit cf092ea3d3bb5012f103bd92f575b0045e8de63a
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:37:58 2022 -0600
drm/openchrome: Remove via_set_sync_polarity()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 32d814882c1b..dd0af1922a58 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -28,50 +28,6 @@
#include "openchrome_drv.h"
-void
-via_set_sync_polarity(struct drm_encoder *encoder, struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode)
-{
- struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
- struct openchrome_drm_private *dev_private =
- encoder->dev->dev_private;
- u8 syncreg = 0;
-
- if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
- syncreg |= BIT(6);
- if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
- syncreg |= BIT(5);
-
- switch (enc->di_port) {
- case VIA_DI_PORT_DVP0:
- svga_wcrt_mask(VGABASE, 0x96, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_DVP1:
- svga_wcrt_mask(VGABASE, 0x9B, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_DFPH:
- svga_wcrt_mask(VGABASE, 0x97, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_DFPL:
- svga_wcrt_mask(VGABASE, 0x99, syncreg, BIT(6) | BIT(5));
- break;
-
- /* For TTL Type LCD */
- case (VIA_DI_PORT_DFPL + VIA_DI_PORT_DVP1):
- svga_wcrt_mask(VGABASE, 0x99, syncreg, BIT(6) | BIT(5));
- svga_wcrt_mask(VGABASE, 0x9B, syncreg, BIT(6) | BIT(5));
- break;
-
- case VIA_DI_PORT_NONE:
- default:
- DRM_ERROR("No DIPort.\n");
- break;
- }
-}
-
void via_encoder_cleanup(struct drm_encoder *encoder)
{
struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 8b1bca2f411b..e83fe737fffd 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -452,9 +452,6 @@ int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
uint32_t index);
/* encoders */
-void via_set_sync_polarity(struct drm_encoder *encoder,
- struct drm_display_mode *mode,
- struct drm_display_mode *adjusted_mode);
void via_encoder_cleanup(struct drm_encoder *encoder);
/* connectors */
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 5332a564426c..b437addc9583 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -381,8 +381,6 @@ via_hdmi_enc_mode_set(struct drm_encoder *encoder,
break;
}
}
-
- via_set_sync_polarity(encoder, mode, adjusted_mode);
}
static const struct drm_encoder_helper_funcs via_hdmi_enc_helper_funcs = {
commit 5551a758f3fea6f142b486846c4754dbdbe697ce
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:37:56 2022 -0600
drm/openchrome: Remove via_hwcursor_init()
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index afbd6708171a..32d814882c1b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -165,26 +165,6 @@ via_init_td_timing_regs(struct drm_device *dev)
}
}
-static void
-via_hwcursor_init(struct openchrome_drm_private *dev_private)
-{
- /* set 0 as transparent color key */
- VIA_WRITE(PRIM_HI_TRANSCOLOR, 0);
- VIA_WRITE(PRIM_HI_FIFO, 0x0D000D0F);
- VIA_WRITE(PRIM_HI_INVTCOLOR, 0X00FFFFFF);
- VIA_WRITE(V327_HI_INVTCOLOR, 0X00FFFFFF);
-
- /* set 0 as transparent color key */
- VIA_WRITE(HI_TRANSPARENT_COLOR, 0);
- VIA_WRITE(HI_INVTCOLOR, 0X00FFFFFF);
- VIA_WRITE(ALPHA_V3_PREFIFO_CONTROL, 0xE0000);
- VIA_WRITE(ALPHA_V3_FIFO_CONTROL, 0xE0F0000);
-
- /* Turn both cursors off. */
- VIA_WRITE(PRIM_HI_CTRL, VIA_READ(PRIM_HI_CTRL) & 0xFFFFFFFA);
- VIA_WRITE(HI_CONTROL, VIA_READ(HI_CONTROL) & 0xFFFFFFFA);
-}
-
static void
via_init_crtc_regs(struct drm_device *dev)
{
@@ -281,8 +261,6 @@ via_modeset_init(struct drm_device *dev)
goto exit;
}
- via_hwcursor_init(dev_private);
-
for (i = 0; i < OPENCHROME_MAX_CRTC; i++) {
ret = openchrome_crtc_init(dev_private, i);
if (ret) {
commit b673621bfef9932921b6ee33e0f499533c02faed
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:37:10 2022 -0600
drm/openchrome: Move via_i2c_reg_init() into openchrome_i2c.c
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index 8dd0725c3fda..afbd6708171a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -165,16 +165,6 @@ via_init_td_timing_regs(struct drm_device *dev)
}
}
-static void via_i2c_reg_init(struct openchrome_drm_private *dev_private)
-{
- svga_wseq_mask(VGABASE, 0x31, 0x30, 0x30);
- svga_wseq_mask(VGABASE, 0x26, 0x30, 0x30);
- vga_wseq(VGABASE, 0x2C, 0xc2);
- vga_wseq(VGABASE, 0x3D, 0xc0);
- svga_wseq_mask(VGABASE, 0x2C, 0x30, 0x30);
- svga_wseq_mask(VGABASE, 0x3D, 0x30, 0x30);
-}
-
static void
via_hwcursor_init(struct openchrome_drm_private *dev_private)
{
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 0c209f54cc45..8b1bca2f411b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -431,6 +431,7 @@ void via_i2c_readbytes(struct i2c_adapter *adapter,
void via_i2c_writebytes(struct i2c_adapter *adapter,
u8 slave_addr, char offset,
u8 *data, unsigned int size);
+void via_i2c_reg_init(struct openchrome_drm_private *dev_private);
int via_i2c_init(struct drm_device *dev);
void via_i2c_exit(void);
diff --git a/drivers/gpu/drm/openchrome/openchrome_i2c.c b/drivers/gpu/drm/openchrome/openchrome_i2c.c
index 48ec7af8b154..e82bebaf5344 100644
--- a/drivers/gpu/drm/openchrome/openchrome_i2c.c
+++ b/drivers/gpu/drm/openchrome/openchrome_i2c.c
@@ -180,6 +180,16 @@ via_i2c_writebytes(struct i2c_adapter *adapter,
kfree(out_buf);
}
+void via_i2c_reg_init(struct openchrome_drm_private *dev_private)
+{
+ svga_wseq_mask(VGABASE, 0x31, 0x30, 0x30);
+ svga_wseq_mask(VGABASE, 0x26, 0x30, 0x30);
+ vga_wseq(VGABASE, 0x2C, 0xc2);
+ vga_wseq(VGABASE, 0x3D, 0xc0);
+ svga_wseq_mask(VGABASE, 0x2C, 0x30, 0x30);
+ svga_wseq_mask(VGABASE, 0x3D, 0x30, 0x30);
+}
+
int via_i2c_init(struct drm_device *dev)
{
int types[] = { SERIAL, SERIAL, GPIO, GPIO, GPIO };
commit 4d927172a06901810c13899b4a6da730b6dce4d5
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Fri Jan 21 16:28:21 2022 -0600
drm/openchrome: Remove extern keyword from non-static functions
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
index 9f186f81d918..b38a726c63e3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc_hw.h
@@ -1048,8 +1048,8 @@ via_tmds_set_display_source(void __iomem *regs, u8 displaySource)
}
-extern void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
-extern void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
+void load_register_tables(void __iomem *regbase, struct vga_registers *regs);
+void load_value_to_registers(void __iomem *regbase, struct vga_registers *regs,
unsigned int value);
#endif /* __CRTC_HW_H__ */
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index db75e013fe4f..0c209f54cc45 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -369,10 +369,8 @@ extern int openchrome_driver_num_ioctls;
extern struct ttm_device_funcs openchrome_bo_driver;
int openchrome_vram_detect(struct openchrome_drm_private *dev_private);
-extern int openchrome_vram_init(
- struct openchrome_drm_private *dev_private);
-extern void openchrome_vram_fini(
- struct openchrome_drm_private *dev_private);
+int openchrome_vram_init(struct openchrome_drm_private *dev_private);
+void openchrome_vram_fini(struct openchrome_drm_private *dev_private);
int openchrome_mmio_init(struct openchrome_drm_private *dev_private);
void openchrome_mmio_fini(struct openchrome_drm_private *dev_private);
void openchrome_graphics_unlock(
@@ -422,60 +420,60 @@ extern const uint32_t openchrome_cursor_formats[];
extern const unsigned int openchrome_cursor_formats_size;
/* display */
-extern int via_modeset_init(struct drm_device *dev);
-extern void via_modeset_fini(struct drm_device *dev);
+int via_modeset_init(struct drm_device *dev);
+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,
+struct i2c_adapter *via_find_ddc_bus(int port);
+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,
+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);
+int via_i2c_init(struct drm_device *dev);
+void via_i2c_exit(void);
/* clock */
-extern u32 via_get_clk_value(struct drm_device *dev, u32 clk);
-extern void via_set_vclock(struct drm_crtc *crtc, u32 clk);
+u32 via_get_clk_value(struct drm_device *dev, u32 clk);
+void via_set_vclock(struct drm_crtc *crtc, u32 clk);
/* framebuffers */
void openchrome_mode_config_init(
struct openchrome_drm_private *dev_private);
-extern int openchrome_fb_init(struct drm_device *dev);
-extern void openchrome_fb_fini(struct drm_device *dev);
+int openchrome_fb_init(struct drm_device *dev);
+void openchrome_fb_fini(struct drm_device *dev);
/* crtc */
-extern void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
+void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
uint32_t index);
/* encoders */
-extern void via_set_sync_polarity(struct drm_encoder *encoder,
+void via_set_sync_polarity(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
-extern void via_encoder_cleanup(struct drm_encoder *encoder);
+void via_encoder_cleanup(struct drm_encoder *encoder);
/* connectors */
-extern int via_connector_mode_valid(struct drm_connector *connector,
+int via_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode);
-extern void via_connector_destroy(struct drm_connector *connector);
-
-extern void via_analog_probe(struct drm_device *dev);
-extern bool openchrome_vt1632_probe(struct i2c_adapter *i2c_bus);
-extern bool openchrome_sii164_probe(struct i2c_adapter *i2c_bus);
-extern void openchrome_ext_dvi_probe(struct drm_device *dev);
-extern void via_tmds_probe(struct drm_device *dev);
-extern void via_fp_probe(struct drm_device *dev);
-
-extern void via_hdmi_init(struct drm_device *dev, u32 di_port);
-extern void via_analog_init(struct drm_device *dev);
-extern void openchrome_vt1632_init(struct drm_device *dev);
-extern void openchrome_sii164_init(struct drm_device *dev);
-extern void openchrome_ext_dvi_init(struct drm_device *dev);
-extern void via_tmds_init(struct drm_device *dev);
-extern void via_fp_init(struct drm_device *dev);
+void via_connector_destroy(struct drm_connector *connector);
+
+void via_analog_probe(struct drm_device *dev);
+bool openchrome_vt1632_probe(struct i2c_adapter *i2c_bus);
+bool openchrome_sii164_probe(struct i2c_adapter *i2c_bus);
+void openchrome_ext_dvi_probe(struct drm_device *dev);
+void via_tmds_probe(struct drm_device *dev);
+void via_fp_probe(struct drm_device *dev);
+
+void via_hdmi_init(struct drm_device *dev, u32 di_port);
+void via_analog_init(struct drm_device *dev);
+void openchrome_vt1632_init(struct drm_device *dev);
+void openchrome_sii164_init(struct drm_device *dev);
+void openchrome_ext_dvi_init(struct drm_device *dev);
+void via_tmds_init(struct drm_device *dev);
+void via_fp_init(struct drm_device *dev);
#endif /* _OPENCHROME_DRV_H */
More information about the openchrome-devel
mailing list