[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 8 commits - drivers/gpu/drm
Kevin Brace
kevinbrace at kemper.freedesktop.org
Fri Jan 13 22:05:28 UTC 2023
drivers/gpu/drm/via/Makefile | 4 -
drivers/gpu/drm/via/via_connector.c | 81 ------------------------------------
drivers/gpu/drm/via/via_dac.c | 1
drivers/gpu/drm/via/via_drv.h | 16 ++-----
drivers/gpu/drm/via/via_encoder.c | 11 ++++
drivers/gpu/drm/via/via_hdmi.c | 2
drivers/gpu/drm/via/via_init.c | 70 +++++++++++++++++++++++++++++++
drivers/gpu/drm/via/via_lvds.c | 1
drivers/gpu/drm/via/via_sii164.c | 1
drivers/gpu/drm/via/via_tmds.c | 1
drivers/gpu/drm/via/via_vt1632.c | 1
11 files changed, 94 insertions(+), 95 deletions(-)
New commits:
commit aa33f324c1403a76db497a1ed7527822be9b8430
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 16:01:12 2023 -0600
drm/via: Include drm/drm_encoder.h where appropriate
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_encoder.c b/drivers/gpu/drm/via/via_encoder.c
index 94ed714c8d45..d7798f2ce5ba 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -24,6 +24,8 @@
* Kevin Brace <kevinbrace at bracecomputerlab.com>
*/
+#include <drm/drm_encoder.h>
+
#include "via_drv.h"
commit a39650f8412da54df1063f6e5da7d3c06fc70765
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 15:56:55 2023 -0600
drm/via: Remove an unnecessary inclusion of linux/pci_ids.h
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_encoder.c b/drivers/gpu/drm/via/via_encoder.c
index f7a4c3dbfc43..94ed714c8d45 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -24,8 +24,6 @@
* Kevin Brace <kevinbrace at bracecomputerlab.com>
*/
-#include <linux/pci_ids.h>
-
#include "via_drv.h"
commit 46190eafba649a7f52b3bec4fed7b6690827d564
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 15:47:21 2023 -0600
drm/via: Remove unnecessary inclusions of linux/pci.h
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_encoder.c b/drivers/gpu/drm/via/via_encoder.c
index 51c9bb990e74..f7a4c3dbfc43 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -24,7 +24,6 @@
* Kevin Brace <kevinbrace at bracecomputerlab.com>
*/
-#include <linux/pci.h>
#include <linux/pci_ids.h>
#include "via_drv.h"
diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index fb147c95beba..b5ab18986c44 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -27,7 +27,6 @@
*/
#include <linux/delay.h>
-#include <linux/pci.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_connector.h>
commit f4c4b20a74deb952c5d41637a2702e45c8995f61
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 15:32:24 2023 -0600
drm/via: Remove an unnecessary inclusion of drm/drm_crtc.h
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_connector.c b/drivers/gpu/drm/via/via_connector.c
index bdc0dc729645..3ebd2783b76f 100644
--- a/drivers/gpu/drm/via/via_connector.c
+++ b/drivers/gpu/drm/via/via_connector.c
@@ -27,7 +27,6 @@
*/
#include <drm/drm_connector.h>
-#include <drm/drm_crtc.h>
#include "via_drv.h"
commit c4ddb9f9d292f732a6f2d1e322576a78d1e2214a
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 14:54:34 2023 -0600
drm/via: Include drm/drm_connector.h where appropriate
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_connector.c b/drivers/gpu/drm/via/via_connector.c
index b153a0e62b65..bdc0dc729645 100644
--- a/drivers/gpu/drm/via/via_connector.c
+++ b/drivers/gpu/drm/via/via_connector.c
@@ -26,6 +26,7 @@
* James Simmons <jsimmons at infradead.org>
*/
+#include <drm/drm_connector.h>
#include <drm/drm_crtc.h>
#include "via_drv.h"
diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index bf0586acd19f..b0b290d6e525 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -29,6 +29,7 @@
#include <linux/pci.h>
#include <drm/drm_atomic_state_helper.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_probe_helper.h>
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 94a9cda3ddc7..ea544fb01195 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -34,6 +34,7 @@
#include <video/vga.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>
#include <drm/drm_plane.h>
diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index 240fac39277b..fb147c95beba 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -30,6 +30,7 @@
#include <linux/pci.h>
#include <drm/drm_atomic_state_helper.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_print.h>
diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index 5a02ef16bd18..cf8ee1b0df49 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -34,6 +34,7 @@
#include <asm/olpc.h>
#include <drm/drm_atomic_state_helper.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_probe_helper.h>
diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index 3c70838b03a7..ad8e0ada8918 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -27,6 +27,7 @@
#include <linux/pci.h>
#include <drm/drm_atomic_state_helper.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_probe_helper.h>
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 18b1e6d5aebc..5112d5884208 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -27,6 +27,7 @@
#include <linux/pci.h>
#include <drm/drm_atomic_state_helper.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_probe_helper.h>
diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index db39add5ed7a..1e4a9ad7e32b 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -27,6 +27,7 @@
#include <linux/pci.h>
#include <drm/drm_atomic_state_helper.h>
+#include <drm/drm_connector.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_probe_helper.h>
commit d6dfe41a325901dd995b8e79dcfebbb55d0355ef
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 13:38:20 2023 -0600
drm/via: Rename via_display.c as via_connector.c
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/Makefile b/drivers/gpu/drm/via/Makefile
index 096128c9d910..1553e5784ebc 100644
--- a/drivers/gpu/drm/via/Makefile
+++ b/drivers/gpu/drm/via/Makefile
@@ -3,11 +3,11 @@
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
ccflags-y := -Iinclude/drm
-via-y := via_crtc.o \
+via-y := via_connector.o \
+ via_crtc.o \
via_crtc_hw.o \
via_cursor.o \
via_dac.o \
- via_display.o \
via_drv.o \
via_encoder.o \
via_hdmi.o \
diff --git a/drivers/gpu/drm/via/via_display.c b/drivers/gpu/drm/via/via_connector.c
similarity index 100%
rename from drivers/gpu/drm/via/via_display.c
rename to drivers/gpu/drm/via/via_connector.c
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 5740841b6de9..94a9cda3ddc7 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -372,6 +372,8 @@ void via_transmitter_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index);
void via_encoder_cleanup(struct drm_encoder *encoder);
+void via_connector_destroy(struct drm_connector *connector);
+
extern const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs;
extern const struct drm_plane_funcs via_cursor_drm_plane_funcs;
extern const uint32_t via_cursor_formats[];
@@ -398,9 +400,6 @@ void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
-/* connectors */
-void via_connector_destroy(struct drm_connector *connector);
-
void via_dac_probe(struct drm_device *dev);
bool via_vt1632_probe(struct i2c_adapter *i2c_bus);
bool via_sii164_probe(struct i2c_adapter *i2c_bus);
commit 467327bf9f70e7ecbd802ca33ad46c3830bc1eea
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Fri Jan 13 13:04:01 2023 -0600
drm/via: Move via_encoder_cleanup() into via_encoder.c
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_display.c b/drivers/gpu/drm/via/via_display.c
index e4a36050fc03..b153a0e62b65 100644
--- a/drivers/gpu/drm/via/via_display.c
+++ b/drivers/gpu/drm/via/via_display.c
@@ -30,14 +30,6 @@
#include "via_drv.h"
-void via_encoder_cleanup(struct drm_encoder *encoder)
-{
- struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
-
- drm_encoder_cleanup(encoder);
- kfree(enc);
-}
-
void via_connector_destroy(struct drm_connector *connector)
{
struct via_connector *con = container_of(connector, struct via_connector, base);
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 41cd601ad869..5740841b6de9 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -370,6 +370,7 @@ void via_transmitter_data_drive_strength(struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
void via_transmitter_display_source(struct via_drm_priv *dev_priv,
u32 di_port, int index);
+void via_encoder_cleanup(struct drm_encoder *encoder);
extern const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs;
extern const struct drm_plane_funcs via_cursor_drm_plane_funcs;
@@ -397,9 +398,6 @@ void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index);
-/* encoders */
-void via_encoder_cleanup(struct drm_encoder *encoder);
-
/* connectors */
void via_connector_destroy(struct drm_connector *connector);
diff --git a/drivers/gpu/drm/via/via_encoder.c b/drivers/gpu/drm/via/via_encoder.c
index 32602136c170..51c9bb990e74 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -222,3 +222,11 @@ void via_transmitter_display_source(struct via_drm_priv *dev_priv,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
+
+void via_encoder_cleanup(struct drm_encoder *encoder)
+{
+ struct via_encoder *enc = container_of(encoder, struct via_encoder, base);
+
+ drm_encoder_cleanup(encoder);
+ kfree(enc);
+}
commit 539173ce9548afb960c6ab536dcd3d33d4cc6fea
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date: Thu Jan 12 20:24:58 2023 -0600
drm/via: Move via_modeset_init/fini() into via_init.c
Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
diff --git a/drivers/gpu/drm/via/via_display.c b/drivers/gpu/drm/via/via_display.c
index 76bcfa470657..e4a36050fc03 100644
--- a/drivers/gpu/drm/via/via_display.c
+++ b/drivers/gpu/drm/via/via_display.c
@@ -26,11 +26,7 @@
* James Simmons <jsimmons at infradead.org>
*/
-#include <linux/pci.h>
-
#include <drm/drm_crtc.h>
-#include <drm/drm_crtc_helper.h>
-#include <drm/drm_probe_helper.h>
#include "via_drv.h"
@@ -56,70 +52,3 @@ void via_connector_destroy(struct drm_connector *connector)
drm_connector_cleanup(connector);
}
-int via_modeset_init(struct drm_device *dev)
-{
- struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
- uint32_t i;
- int ret = 0;
-
- via_mode_config_init(dev_priv);
-
- /* Initialize the number of display connectors. */
- dev_priv->number_fp = 0;
- dev_priv->number_dvi = 0;
-
- via_i2c_reg_init(dev_priv);
- ret = via_i2c_init(dev);
- if (ret) {
- DRM_ERROR("Failed to initialize I2C bus!\n");
- goto exit;
- }
-
- for (i = 0; i < VIA_MAX_CRTC; i++) {
- ret = via_crtc_init(dev_priv, i);
- if (ret) {
- goto exit;
- }
- }
-
- via_ext_dvi_probe(dev);
- via_tmds_probe(dev);
-
- via_lvds_probe(dev);
-
- via_dac_probe(dev);
-
-
- via_ext_dvi_init(dev);
- via_tmds_init(dev);
-
- via_dac_init(dev);
-
- via_lvds_init(dev);
-
- switch (pdev->device) {
- case PCI_DEVICE_ID_VIA_CHROME9_HD:
- via_hdmi_init(dev, VIA_DI_PORT_NONE);
- break;
- default:
- break;
- }
-
- drm_mode_config_reset(dev);
-
- drm_kms_helper_poll_init(dev);
-exit:
- return ret;
-}
-
-void via_modeset_fini(struct drm_device *dev)
-{
- drm_kms_helper_poll_fini(dev);
-
- drm_helper_force_disable_all(dev);
-
- drm_mode_config_cleanup(dev);
-
- via_i2c_exit();
-}
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 2f3b18429b23..41cd601ad869 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -338,6 +338,8 @@ void via_graphics_unlock(struct via_drm_priv *dev_priv);
int via_device_init(struct via_drm_priv *dev_priv);
void via_device_fini(struct via_drm_priv *dev_priv);
void via_mode_config_init(struct via_drm_priv *dev_priv);
+int via_modeset_init(struct drm_device *dev);
+void via_modeset_fini(struct drm_device *dev);
int via_drm_init(struct drm_device *dev);
void via_drm_fini(struct drm_device *dev);
@@ -374,10 +376,6 @@ extern const struct drm_plane_funcs via_cursor_drm_plane_funcs;
extern const uint32_t via_cursor_formats[];
extern const unsigned int via_cursor_formats_size;
-/* display */
-int via_modeset_init(struct drm_device *dev);
-void via_modeset_fini(struct drm_device *dev);
-
/* i2c */
struct i2c_adapter *via_find_ddc_bus(int port);
void via_i2c_readbytes(struct i2c_adapter *adapter,
diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 701c02be4737..43711fb8ac77 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -33,8 +33,10 @@
#include <linux/pci.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_crtc_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_mode_config.h>
+#include <drm/drm_probe_helper.h>
#include "via_drv.h"
@@ -1243,6 +1245,74 @@ void via_mode_config_init(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}
+int via_modeset_init(struct drm_device *dev)
+{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+ struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
+ uint32_t i;
+ int ret = 0;
+
+ via_mode_config_init(dev_priv);
+
+ /* Initialize the number of display connectors. */
+ dev_priv->number_fp = 0;
+ dev_priv->number_dvi = 0;
+
+ via_i2c_reg_init(dev_priv);
+ ret = via_i2c_init(dev);
+ if (ret) {
+ DRM_ERROR("Failed to initialize I2C bus!\n");
+ goto exit;
+ }
+
+ for (i = 0; i < VIA_MAX_CRTC; i++) {
+ ret = via_crtc_init(dev_priv, i);
+ if (ret) {
+ goto exit;
+ }
+ }
+
+ via_ext_dvi_probe(dev);
+ via_tmds_probe(dev);
+
+ via_lvds_probe(dev);
+
+ via_dac_probe(dev);
+
+
+ via_ext_dvi_init(dev);
+ via_tmds_init(dev);
+
+ via_dac_init(dev);
+
+ via_lvds_init(dev);
+
+ switch (pdev->device) {
+ case PCI_DEVICE_ID_VIA_CHROME9_HD:
+ via_hdmi_init(dev, VIA_DI_PORT_NONE);
+ break;
+ default:
+ break;
+ }
+
+ drm_mode_config_reset(dev);
+
+ drm_kms_helper_poll_init(dev);
+exit:
+ return ret;
+}
+
+void via_modeset_fini(struct drm_device *dev)
+{
+ drm_kms_helper_poll_fini(dev);
+
+ drm_helper_force_disable_all(dev);
+
+ drm_mode_config_cleanup(dev);
+
+ via_i2c_exit();
+}
+
int via_drm_init(struct drm_device *dev)
{
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
More information about the openchrome-devel
mailing list