[Openchrome-devel] drm-openchrome: Branch 'drm-next-4.17' - 3 commits - drivers/gpu/drm

2018-04-03 Thread Kevin Brace
 drivers/gpu/drm/openchrome/via_drv.h   |7 ---
 drivers/gpu/drm/openchrome/via_ioc32.c |3 ---
 drivers/gpu/drm/openchrome/via_sgdma.c |7 +++
 drivers/gpu/drm/openchrome/via_ttm.c   |   19 ---
 4 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit f5fd7fe7c2780b607d9185be0eb1f42cf7915153
Author: Kevin Brace 
Date:   Tue Apr 3 20:38:59 2018 -0700

drm/openchrome: Remove read_domains and write_domain from drm_gem_object

Refer to commit c0a51fd.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/via_ioc32.c 
b/drivers/gpu/drm/openchrome/via_ioc32.c
index b84ed22b944f..f3a335a1ac57 100644
--- a/drivers/gpu/drm/openchrome/via_ioc32.c
+++ b/drivers/gpu/drm/openchrome/via_ioc32.c
@@ -81,7 +81,6 @@ via_gem_alloc(struct drm_device *dev, void *data,
args->offset = bo->offset;
args->size = bo->mem.size;
args->version = 1;
-   obj->read_domains = obj->write_domain = args->domains;
}
}
return ret;
@@ -122,8 +121,6 @@ via_gem_state(struct drm_device *dev, void *data, struct 
drm_file *file_priv)
args->domains = bo->mem.placement & TTM_PL_MASK_MEM;
args->offset = bo->offset;
args->size = bo->mem.size;
-
-   obj->read_domains = obj->write_domain = args->domains;
}
}
mutex_lock(>struct_mutex);
commit dac0d8095d9cdfd7396a01950a6d29ffdd451237
Author: Kevin Brace 
Date:   Tue Apr 3 20:13:22 2018 -0700

drm/openchrome: Add BO as parameter to the ttm_tt_create callback

Refer to commit dde5da2 and 81f5ec0.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/via_drv.h 
b/drivers/gpu/drm/openchrome/via_drv.h
index c1beef590ece..535927afa908 100644
--- a/drivers/gpu/drm/openchrome/via_drv.h
+++ b/drivers/gpu/drm/openchrome/via_drv.h
@@ -43,6 +43,7 @@
 #include "ttm/ttm_memory.h"
 #include "ttm/ttm_module.h"
 #include "ttm/ttm_page_alloc.h"
+#include "ttm/ttm_tt.h"
 
 #include 
 #include 
@@ -335,8 +336,8 @@ ttm_gem_create(struct drm_device *dev,
bool interruptible);
 extern struct ttm_buffer_object *ttm_gem_mapping(struct drm_gem_object *obj);
 
-extern struct ttm_tt *
-via_sgdma_backend_init(struct ttm_bo_device *bdev, unsigned long size,
-   uint32_t page_flags, struct page *dummy_read_page);
+extern struct ttm_tt* via_sgdma_backend_init(
+   struct ttm_buffer_object *bo,
+   uint32_t page_flags);
 
 #endif
diff --git a/drivers/gpu/drm/openchrome/via_sgdma.c 
b/drivers/gpu/drm/openchrome/via_sgdma.c
index 83ed1349db11..e6fcbf79836f 100644
--- a/drivers/gpu/drm/openchrome/via_sgdma.c
+++ b/drivers/gpu/drm/openchrome/via_sgdma.c
@@ -95,9 +95,8 @@ static struct ttm_backend_func ttm_sgdma_func = {
.destroy = via_sgdma_destroy,
 };
 
-struct ttm_tt *
-via_sgdma_backend_init(struct ttm_bo_device *bdev, unsigned long size,
-   uint32_t page_flags, struct page *dummy_read_page)
+struct ttm_tt* via_sgdma_backend_init(struct ttm_buffer_object *bo,
+   uint32_t page_flags)
 {
struct sgdma_tt *dma_tt;
 
@@ -107,7 +106,7 @@ via_sgdma_backend_init(struct ttm_bo_device *bdev, unsigned 
long size,
 
dma_tt->sgdma.ttm.func = _sgdma_func;
 
-   if (ttm_dma_tt_init(_tt->sgdma, bdev, size, page_flags, 
dummy_read_page)) {
+   if (ttm_dma_tt_init(_tt->sgdma, bo, page_flags)) {
kfree(dma_tt);
return NULL;
}
diff --git a/drivers/gpu/drm/openchrome/via_ttm.c 
b/drivers/gpu/drm/openchrome/via_ttm.c
index 80b073ad6404..b9cc11014497 100644
--- a/drivers/gpu/drm/openchrome/via_ttm.c
+++ b/drivers/gpu/drm/openchrome/via_ttm.c
@@ -105,24 +105,21 @@ via_ttm_bo_destroy(struct ttm_buffer_object *bo)
 heap = NULL;
 }
 
-static struct ttm_tt *
-via_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
-   uint32_t page_flags, struct page *dummy_read_page)
+struct ttm_tt* via_ttm_tt_create(struct ttm_buffer_object *bo,
+   uint32_t page_flags)
 {
-   struct via_device *dev_priv = container_of(bdev,
+   struct via_device *dev_priv = container_of(bo->bdev,
struct via_device, ttm.bdev);
 
 #if IS_ENABLED(CONFIG_AGP)
if (pci_find_capability(dev_priv->dev->pdev, PCI_CAP_ID_AGP)) {
-   return ttm_agp_tt_create(bdev,
-   dev_priv->dev->agp->bridge,
-   size, page_flags, dummy_read_page);
+   return ttm_agp_tt_create(bo,
+   dev_priv->dev->agp->bridge,
+ 

[Openchrome-devel] drm-openchrome: Branch 'drm-next-4.17' - 3 commits - drivers/gpu/drm

2018-04-03 Thread Kevin Brace
 drivers/gpu/drm/openchrome/via_drv.h  |4 ++--
 drivers/gpu/drm/openchrome/via_tmds.c |   30 --
 2 files changed, 10 insertions(+), 24 deletions(-)

New commits:
commit 8a2cb9879f56e70df72cf9630454dc6ee82734b6
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Tue Apr 3 22:21:46 2018 -0700

drm/openchrome: Version bumped to 3.0.80

Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_drv.h 
b/drivers/gpu/drm/openchrome/via_drv.h
index 535927afa908..95e0318ea3a7 100644
--- a/drivers/gpu/drm/openchrome/via_drv.h
+++ b/drivers/gpu/drm/openchrome/via_drv.h
@@ -30,11 +30,11 @@
 #define DRIVER_AUTHOR   "OpenChrome Project"
 #define DRIVER_NAME "openchrome"
 #define DRIVER_DESC "OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE "20180327"
+#define DRIVER_DATE "20180403"
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   0
-#define DRIVER_PATCHLEVEL  79
+#define DRIVER_PATCHLEVEL  80
 #include 
 
 #include "ttm/ttm_bo_api.h"
commit 51d01e444644b24e82819ffc7545ecea2c372008
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Tue Apr 3 22:20:23 2018 -0700

drm/openchrome: Improve integrated DVI transmitter display detection

Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_tmds.c 
b/drivers/gpu/drm/openchrome/via_tmds.c
index ec6ab74c767f..535ebcfa1bc6 100644
--- a/drivers/gpu/drm/openchrome/via_tmds.c
+++ b/drivers/gpu/drm/openchrome/via_tmds.c
@@ -313,8 +313,6 @@ via_tmds_detect(struct drm_connector *connector, bool force)
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   drm_mode_connector_update_edid_property(connector, edid);
-
if (con->i2c_bus & VIA_I2C_BUS2) {
i2c_bus = via_find_ddc_bus(0x31);
} else if (con->i2c_bus & VIA_I2C_BUS3) {
@@ -366,10 +364,14 @@ static int via_tmds_get_modes(struct drm_connector 
*connector)
 
if (i2c_bus) {
edid = drm_get_edid(>base, i2c_bus);
-   if (edid) {
+   if (edid->input & DRM_EDID_INPUT_DIGITAL) {
+   drm_mode_connector_update_edid_property(connector,
+   edid);
count = drm_add_edid_modes(connector, edid);
-   kfree(edid);
+   DRM_DEBUG_KMS("DVI EDID information was obtained.\n");
}
+
+   kfree(edid);
}
 
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
commit af4935eb8c3380482dd068cc65651c44ee12600d
Author: Kevin Brace <kevinbr...@gmx.com>
Date:   Tue Apr 3 22:19:01 2018 -0700

drm/openchrome: Discontinuing the support for DVI-A for DVI

Supporting DVI-A causes display detection complications with analog (VGA)
detection, so its support is discontinued.

Signed-off-by: Kevin Brace <kevinbr...@gmx.com>

diff --git a/drivers/gpu/drm/openchrome/via_tmds.c 
b/drivers/gpu/drm/openchrome/via_tmds.c
index dda5c2893701..ec6ab74c767f 100644
--- a/drivers/gpu/drm/openchrome/via_tmds.c
+++ b/drivers/gpu/drm/openchrome/via_tmds.c
@@ -326,8 +326,7 @@ via_tmds_detect(struct drm_connector *connector, bool force)
if (i2c_bus) {
edid = drm_get_edid(>base, i2c_bus);
if (edid) {
-   if ((connector->connector_type == 
DRM_MODE_CONNECTOR_DVIA) ^
-   (edid->input & DRM_EDID_INPUT_DIGITAL)) {
+   if (edid->input & DRM_EDID_INPUT_DIGITAL) {

drm_mode_connector_update_edid_property(connector, edid);
ret = connector_status_connected;
}
@@ -474,7 +473,7 @@ void via_tmds_init(struct drm_device *dev)
goto exit;
}
 
-   enc = kzalloc(sizeof(*enc) + 2 * sizeof(*con), GFP_KERNEL);
+   enc = kzalloc(sizeof(*enc) + sizeof(*con), GFP_KERNEL);
if (!enc) {
DRM_ERROR("Failed to allocate connector "
"and encoder.\n");
@@ -495,7 +494,6 @@ void via_tmds_init(struct drm_device *dev)
dev_priv->number_dvi++;
 
 
-   /* Piece together our DVI-D connector. */
con = >cons[0];
drm_connector_init(dev, >base, _dvi_connector_funcs,
DRM_MODE_CONNECTOR_DVID);
@@ -508,20 +506,6 @@ void via_tmds_init(struct drm_device *dev)
INIT_LIST_HEAD(>props);
 
drm_mode_connector_attach_encoder(>base, >base);
-
-   /* Now handle the DVI-A case. */
-   con = >cons[1];
-   drm_connector_init(dev, >base, _dvi_connector_funcs,
-