drm-openchrome: Branch 'drm-next-6.8' - 15 commits - drivers/gpu/drm

2024-01-16 Thread Kevin Brace
 drivers/gpu/drm/i915/display/intel_cx0_phy.c   |   25 ---
 drivers/gpu/drm/i915/display/intel_display_power.c |4 -
 drivers/gpu/drm/i915/display/intel_dp.c|2 
 drivers/gpu/drm/i915/display/intel_psr.c   |   10 +-
 drivers/gpu/drm/i915/gem/i915_gem_context_types.h  |4 -
 drivers/gpu/drm/i915/gt/intel_gsc.h|7 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.h |   75 +++--
 drivers/gpu/drm/i915/i915_perf_types.h |9 +-
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c   |4 +
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c|2 
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c |8 --
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c   |4 -
 drivers/gpu/drm/v3d/v3d_debugfs.c  |   20 ++---
 13 files changed, 96 insertions(+), 78 deletions(-)

New commits:
commit d6b706bb0a205f5c9f165a801697f3da678a6790
Merge: 8ff65229f2d0 205e18c13545
Author: Kevin Brace 
Date:   Tue Jan 16 15:48:04 2024 -0600

Merge tag 'drm-next-2024-01-15' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.8

drm fixes for 6.8-rc1

i915:
- Fixes for kernel-doc warnings enforced in linux-next
- Another build warning fix for string formatting of intel_wakeref_t
- Display fixes for DP DSC BPC and C20 PLL state verification

v3d:
- register readout fix

rockchip:
- two build warning fixes

nouveau:
- fix GSP loading on Turing with different nvdec configuration

commit 205e18c13545ab43cc4fe4930732b4feef551198
Author: Dave Airlie 
Date:   Wed Jan 10 11:14:05 2024 +1000

nouveau/gsp: handle engines in runl without nonstall interrupts.

It appears on TU106 GPUs (2070), that some of the nvdec engines
are in the runlist but have no valid nonstall interrupt, nouveau
didn't handle that too well.

This should let nouveau/gsp work on those.

Cc: sta...@vger.kernel.org # v6.7+
Signed-off-by: Dave Airlie 
Link: 
https://lore.kernel.org/all/20240110011826.3996289-1-airl...@gmail.com/

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c
index c8ce7ff18713..e74493a4569e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ga100.c
@@ -550,6 +550,10 @@ ga100_fifo_nonstall_ctor(struct nvkm_fifo *fifo)
struct nvkm_engn *engn = list_first_entry(>engns, 
typeof(*engn), head);
 
runl->nonstall.vector = engn->func->nonstall(engn);
+
+   /* if no nonstall vector just keep going */
+   if (runl->nonstall.vector == -1)
+   continue;
if (runl->nonstall.vector < 0) {
RUNL_ERROR(runl, "nonstall %d", runl->nonstall.vector);
return runl->nonstall.vector;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c
index d088e636edc3..de2ebe8f2134 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c
@@ -350,7 +350,7 @@ r535_engn_nonstall(struct nvkm_engn *engn)
int ret;
 
ret = nvkm_gsp_intr_nonstall(subdev->device->gsp, subdev->type, 
subdev->inst);
-   WARN_ON(ret < 0);
+   WARN_ON(ret == -ENOENT);
return ret;
 }
 
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c
index 04bceaa28a19..da1bebb896f7 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c
@@ -25,12 +25,8 @@ int
 nvkm_gsp_intr_nonstall(struct nvkm_gsp *gsp, enum nvkm_subdev_type type, int 
inst)
 {
for (int i = 0; i < gsp->intr_nr; i++) {
-   if (gsp->intr[i].type == type && gsp->intr[i].inst == inst) {
-   if (gsp->intr[i].nonstall != ~0)
-   return gsp->intr[i].nonstall;
-
-   return -EINVAL;
-   }
+   if (gsp->intr[i].type == type && gsp->intr[i].inst == inst)
+   return gsp->intr[i].nonstall;
}
 
return -ENOENT;
commit 9caaeb090174a5486f9e410b4f561f7569ce2654
Merge: e8aaca57f9d9 89fe46019a62
Author: Dave Airlie 
Date:   Mon Jan 15 10:09:33 2024 +1000

Merge tag 'drm-misc-next-fixes-2024-01-11' of 
git://anongit.freedesktop.org/drm/drm-misc into drm-next

A fix for the v3d register readout, and two compilation fixes for
rockchip.

Signed-off-by: Dave Airlie 

From: Maxime Ripard 
Link: 
https://patchwork.freedesktop.org/patch/msgid/warlsyhbwarbezejzokxvrpnmvoaajonj6khjobvnfrhttrsks@fqoeqrjrct6l

commit e8aaca57f9d95be26f179137821ad447678a17ca
Merge: b76c01f1d950 d505a16e00c3
Author

drm-openchrome: Branch 'drm-next-6.8' - drivers/gpu/drm

2024-01-16 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8ff65229f2d0dea5d4dcd44616652e09617a0437
Author: Kevin Brace 
Date:   Tue Jan 16 15:16:28 2024 -0600

drm/via: Remove DRM_UNLOCKED from OpenChrome DRM uAPI IOCTL flags

It probably should not have been added to the OpenChrome DRM uAPI IOCTL
flags entry in the first place.  This commit is in response to commit
2798ffc (drm: Remove locking for legacy ioctls and DRM_UNLOCKED).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 932afe95ce6d..2f5155a193f4 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -169,8 +169,8 @@ static const struct drm_ioctl_desc via_driver_ioctls[] = {
DRM_IOCTL_DEF_DRV(VIA_WAIT_IRQ, drm_invalid_op, DRM_AUTH),
DRM_IOCTL_DEF_DRV(VIA_DMA_BLIT, drm_invalid_op, DRM_AUTH),
DRM_IOCTL_DEF_DRV(VIA_BLIT_SYNC, drm_invalid_op, DRM_AUTH),
-   DRM_IOCTL_DEF_DRV(VIA_GEM_ALLOC, via_gem_alloc_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
-   DRM_IOCTL_DEF_DRV(VIA_GEM_MMAP, via_gem_mmap_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
+   DRM_IOCTL_DEF_DRV(VIA_GEM_ALLOC, via_gem_alloc_ioctl, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_GEM_MMAP, via_gem_mmap_ioctl, DRM_AUTH),
 };
 
 static const struct file_operations via_driver_fops = {


drm-openchrome: Changes to 'drm-next-6.8'

2024-01-15 Thread Kevin Brace
New branch 'drm-next-6.8' available with the following commits:


drm-openchrome: Branch 'drm-next-6.7' - 25 commits - drivers/gpu/drm

2024-01-15 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.h  |4 
 drivers/gpu/drm/via/via_init.c |  788 +++--
 2 files changed, 457 insertions(+), 335 deletions(-)

New commits:
commit dc291cb344c2267b6415b830ec426f8e4dd49124
Author: Kevin Brace 
Date:   Mon Jan 15 18:15:58 2024 -0600

drm/via: Version bumped to 3.6.13

Made improvements to via_vram_init().  P4M900 family will now properly
recognize DDR2-667.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 0c035b907bf3..64ff475c1305 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  12
+#define DRIVER_PATCHLEVEL  13
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230929"
+#define DRIVER_DATE"20240115"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 0e19d2e209bb9edb1f10772d2bf22cee602ec128
Author: Kevin Brace 
Date:   Mon Jan 15 18:15:58 2024 -0600

drm/via: Detect VRAM size before detecting speed and memory type

This reduces some redundant error checking code.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 39dda8bf81d5..be1c2783703b 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -952,58 +952,44 @@ static int via_vram_init(struct drm_device *dev)
 
/* CLE266 */
case PCI_DEVICE_ID_VIA_862X_0:
-   ret = cle266_mem_type(dev);
-   if (ret) {
-   goto exit;
-   }
-
ret = pci_read_config_byte(bridge_fn0_dev, 0xe1, );
if (ret) {
goto error_pci_cfg_read;
}
 
dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
+
+   ret = cle266_mem_type(dev);
break;
 
/* KM400(A) / KN400(A) */
case PCI_DEVICE_ID_VIA_8378_0:
-   ret = km400_mem_type(dev);
-   if (ret) {
-   goto exit;
-   }
-
ret = pci_read_config_byte(bridge_fn0_dev, 0xe1, );
if (ret) {
goto error_pci_cfg_read;
}
 
dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
+
+   ret = km400_mem_type(dev);
break;
 
/* P4M800 */
case PCI_DEVICE_ID_VIA_3296_0:
-   ret = p4m800_mem_type(dev);
-   if (ret) {
-   goto exit;
-   }
-
ret = pci_read_config_byte(bridge_fn3_dev, 0xa1, );
if (ret) {
goto error_pci_cfg_read;
}
 
dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
+
+   ret = p4m800_mem_type(dev);
break;
 
/* K8M800(A) / K8N800(A) */
case PCI_DEVICE_ID_VIA_8380_0:
/* K8M890 / K8N890 */
case PCI_DEVICE_ID_VIA_VT3336:
-   ret = km8xx_mem_type(dev);
-   if (ret) {
-   goto exit;
-   }
-
ret = pci_read_config_byte(bridge_fn3_dev, 0xa1, );
if (ret) {
goto error_pci_cfg_read;
@@ -1015,21 +1001,19 @@ static int via_vram_init(struct drm_device *dev)
dev_priv->vram_size <<= 2;
}
 
+   ret = km8xx_mem_type(dev);
break;
 
/* CN400 / PM800 / PN800 / PM880 / PN880 */
case PCI_DEVICE_ID_VIA_PX8X0_0:
-   ret = cn400_mem_type(dev);
-   if (ret) {
-   goto exit;
-   }
-
ret = pci_read_config_byte(bridge_fn3_dev, 0xa1, );
if (ret) {
goto error_pci_cfg_read;
}
 
dev_priv->vram_size = (1 << ((size & 0x70) >> 4)) << 20;
+
+   ret = cn400_mem_type(dev);
break;
 
/* P

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.7' - 5 commits - drivers/gpu/drm

2023-10-06 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.h|  117 ---
 drivers/gpu/drm/via/via_object.c |   15 ++---
 drivers/gpu/drm/via/via_pm.c |   10 +--
 3 files changed, 73 insertions(+), 69 deletions(-)

New commits:
commit 5fe6fa6222c6d422d33ccf428ac50a768cad9b84
Author: Kevin Brace 
Date:   Fri Oct 6 14:21:13 2023 -0700

drm/via: Alter via_object.c error messages slightly

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index 78d232eb306e..f4e9d33ff319 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -182,7 +182,7 @@ int via_bo_create(struct drm_device *dev,
 
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
if (!bo) {
-   drm_err(dev, "Cannot allocate a TTM buffer object.\n");
+   drm_err(dev, "Cannot allocate a TTM buffer object!\n");
ret = -ENOMEM;
goto exit;
}
@@ -198,7 +198,7 @@ int via_bo_create(struct drm_device *dev,
 
ret = drm_gem_object_init(dev, _bo->base, size);
if (ret) {
-   drm_err(dev, "Cannot initialize a GEM object.\n");
+   drm_err(dev, "Cannot initialize a GEM object!\n");
goto error;
}
 
@@ -210,7 +210,7 @@ int via_bo_create(struct drm_device *dev,
PAGE_SIZE >> PAGE_SHIFT, false,
NULL, NULL, via_ttm_bo_destroy);
if (ret) {
-   drm_err(dev, "Cannot initialize a TTM object.\n");
+   drm_err(dev, "Cannot initialize a TTM object!\n");
goto exit;
}
 
@@ -291,7 +291,7 @@ int via_mm_init(struct drm_device *dev)
false,
true);
if (ret) {
-   drm_err(dev, "Failed initializing buffer object driver.\n");
+   drm_err(dev, "Failed initializing buffer object driver!\n");
goto exit;
}
 
@@ -301,7 +301,7 @@ int via_mm_init(struct drm_device *dev)
ret = ttm_range_man_init(_priv->bdev, TTM_PL_VRAM, false,
dev_priv->vram_size >> PAGE_SHIFT);
if (ret) {
-   drm_err(dev, "Failed initializing TTM VRAM memory manager.\n");
+   drm_err(dev, "Failed initializing TTM VRAM memory manager!\n");
goto error_ttm_range_man;
}
 
commit 976549117c281dfb463f34a3a47e79a1274ab11c
Author: Kevin Brace 
Date:   Fri Oct 6 13:59:57 2023 -0700

drm/via: Small indentation adjustment of via_object.c

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index 34d959e6c0b3..78d232eb306e 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -298,9 +298,8 @@ int via_mm_init(struct drm_device *dev)
/*
 * Initialize TTM range manager for VRAM management.
 */
-   ret = ttm_range_man_init(_priv->bdev, TTM_PL_VRAM,
-   false,
-   dev_priv->vram_size >> PAGE_SHIFT);
+   ret = ttm_range_man_init(_priv->bdev, TTM_PL_VRAM, false,
+   dev_priv->vram_size >> PAGE_SHIFT);
if (ret) {
drm_err(dev, "Failed initializing TTM VRAM memory manager.\n");
goto error_ttm_range_man;
commit 3b398d61132997fccbf932b11a4d0334825fe38a
Author: Kevin Brace 
Date:   Fri Oct 6 13:16:39 2023 -0700

drm/via: Alter via_pm.c error messages slightly

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_pm.c b/drivers/gpu/drm/via/via_pm.c
index f5efa9e89abc..563525c41af8 100644
--- a/drivers/gpu/drm/via/via_pm.c
+++ b/drivers/gpu/drm/via/via_pm.c
@@ -84,7 +84,7 @@ int via_dev_pm_ops_suspend(struct device *dev)
 
ret = drm_mode_config_helper_suspend(drm_dev);
if (ret) {
-   drm_err(drm_dev, "Failed to prepare for suspend.\n");
+   drm_err(drm_dev, "Failed to prepare for suspend!\n");
goto exit;
}
 
@@ -107,8 +107,8 @@ int via_dev_pm_ops_resume(struct device *dev)
drm_dbg_driver(drm_dev, "Entered %s.\n", __func__);
 
if (pci_enable_device(pdev)) {
-   drm_err(drm_dev, "Failed to initialize a PCI "
-   "after resume.\n");
+   drm_err(drm_dev, "Failed to reinitialize a PCI device "
+   "after resume!\n");
ret = -EIO;
goto exit;
}
@@ -178,8 +178,8 @@ int via_dev_pm_ops_resume(struct device *dev)
 
ret = drm_mode_config_

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.7' - 11 commits - drivers/gpu/drm

2023-09-29 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.c|   20 +-
 drivers/gpu/drm/via/via_drv.h|4 
 drivers/gpu/drm/via/via_init.c   |  349 ++-
 drivers/gpu/drm/via/via_ioctl.c  |8 
 drivers/gpu/drm/via/via_object.c |   41 ++--
 drivers/gpu/drm/via/via_pm.c |8 
 drivers/gpu/drm/via/via_ttm.c|   16 -
 7 files changed, 219 insertions(+), 227 deletions(-)

New commits:
commit 885ceb7b80f7c60dd330eca2cdd0030e392a6528
Author: Kevin Brace 
Date:   Fri Sep 29 14:54:29 2023 -0700

drm/via: Version bumped to 3.6.12

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index b7a273d614da..3feea09c830b 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  11
+#define DRIVER_PATCHLEVEL  12
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230909"
+#define DRIVER_DATE"20230929"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 44744ad966200442a83ce3d52834fdbe75a8d203
Author: Kevin Brace 
Date:   Fri Sep 29 14:54:27 2023 -0700

drm/via: Improve the error handling of via_drm_init()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 330738dacd8c..661bf6e199fc 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1310,28 +1310,28 @@ int via_drm_init(struct drm_device *dev)
 
ret = via_device_init(dev);
if (ret) {
-   drm_err(dev, "Failed to initialize Chrome IGP.\n");
+   drm_err(dev, "Failed to initialize Chrome IGP!\n");
goto exit;
}
 
ret = via_mm_init(dev);
if (ret) {
-   drm_err(dev, "Failed to initialize TTM.\n");
-   goto exit;
+   drm_err(dev, "Failed to initialize TTM!\n");
+   goto error_mm_init;
}
 
via_chip_revision_info(dev);
 
ret = via_modeset_init(dev);
if (ret) {
-   drm_err(dev, "Failed to initialize mode setting.\n");
-   goto error_modeset;
+   drm_err(dev, "Failed to initialize mode setting!\n");
+   goto error_modeset_init;
}
 
goto exit;
-error_modeset:
-   via_modeset_fini(dev);
+error_modeset_init:
via_mm_fini(dev);
+error_mm_init:
via_device_fini(dev);
 exit:
    drm_dbg_driver(dev, "Exiting %s.\n", __func__);
commit 2bff347ccb0f020f05faa2c200976bbf2a40f3ac
Author: Kevin Brace 
Date:   Fri Sep 29 14:54:26 2023 -0700

drm/via: Improve the error handling of via_modeset_init()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 9a3340b42f7c..330738dacd8c 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1255,7 +1255,8 @@ int via_modeset_init(struct drm_device *dev)
for (i = 0; i < VIA_MAX_CRTC; i++) {
ret = via_crtc_init(dev_priv, i);
if (ret) {
-   goto exit;
+   drm_err(dev, "Failed to initialize CRTC %u!\n", i + 1);
+   goto error_crtc_init;
}
}
 
@@ -1285,6 +1286,9 @@ int via_modeset_init(struct drm_device *dev)
drm_mode_config_reset(dev);
 
drm_kms_helper_poll_init(dev);
+   goto exit;
+error_crtc_init:
+   via_i2c_exit();
 exit:
return ret;
 }
commit 939181bbc84c18f3f578954aedd8f36ee34ccef2
Author: Kevin Brace 
Date:   Fri Sep 29 14:54:24 2023 -0700

drm/via: Convert to use drmm_mode_config_init()

drm_mode_config_init() is deprecated, so switch to the newer version.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index e0f589e848d2..9a3340b42f7c 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1226,8 +1226,6 @@ int via_modeset_init(struct drm_device *dev)
dev_priv->number_fp = 0;
dev_priv->number_dvi = 0;
 
-   drm_mode_config_init(dev);
-
dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0;
dev->mode_config.max_width = 2044;
@@ -1240,6 +1238,13 @@ int via_modeset_init(struct drm_device *dev)
dev->mode_config.cursor_width =
dev->mode_config.cursor_height = VIA_CURSOR_SIZE;
 
+   ret = drmm_mode_config_init(dev);
+   if (ret) {
+   drm_err(dev, "Failed to initialize mode setting "
+   "configuration!\n");
+  

[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.7'

2023-09-09 Thread Kevin Brace
New branch 'drm-next-6.7' available with the following commits:


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

2023-09-09 Thread Kevin Brace
 drivers/gpu/drm/via/via_cursor.c |2 +-
 drivers/gpu/drm/via/via_drv.c|2 --
 drivers/gpu/drm/via/via_drv.h|4 ++--
 3 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 5e11d4f0853576c31cd8c2b8b6dfbfdce3db04f8
Author: Kevin Brace 
Date:   Sat Sep 9 20:55:40 2023 -0700

drm/via: Version bumped to 3.6.11

Using the previous DRM_FORMAT_XRGB setting causes strange
frame buffer errors and the loss of hardware cursor.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 74aa149fea16..b7a273d614da 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  10
+#define DRIVER_PATCHLEVEL  11
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230728"
+#define DRIVER_DATE"20230909"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 86d6bfd9102e6733cdeaf5acbaf29033475c5c4c
Author: Kevin Brace 
Date:   Sat Sep 9 20:54:32 2023 -0700

Revert "drm/via: Use DRM_FORMAT_XRGB format for cursor plane"

This reverts commit e8f1b49a3c20099671b555817e0148cd0b54d82d.

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index 1132c45ac1c6..9e38b9c37d55 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -408,7 +408,7 @@ const struct drm_plane_funcs via_cursor_drm_plane_funcs = {
 };
 
 const uint32_t via_cursor_formats[] = {
-   DRM_FORMAT_XRGB,
+   DRM_FORMAT_ARGB,
 };
 
 const unsigned int via_cursor_formats_size =
commit b0a2d3b910f992c1024c7caf25ba8eb31fd4aa1d
Author: Kevin Brace 
Date:   Sat Sep 9 20:54:31 2023 -0700

drm: Remove struct drm_driver.gem_prime_mmap

Based on commit 0adec22 (drm: Remove struct drm_driver.gem_prime_mmap).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index facdba3656e8..0a97949d6d37 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -188,8 +188,6 @@ static struct drm_driver via_driver = {
.postclose = via_driver_postclose,
.lastclose = via_driver_lastclose,
 
-   .gem_prime_mmap = drm_gem_prime_mmap,
-
.dumb_create = via_driver_dumb_create,
.dumb_map_offset = via_driver_dumb_map_offset,
 


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.6' - 55 commits - Documentation/gpu/amdgpu drivers/accel/ivpu drivers/gpu/drm

2023-09-09 Thread Kevin Brace
 Documentation/gpu/amdgpu/driver-misc.rst |8 
 drivers/accel/ivpu/ivpu_jsm_msg.c|3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c   |8 
 drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c |   18 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   |   18 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c   |   30 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c|   15 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c  |   26 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h  |3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c  |   11 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h  |3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c  |   15 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c   |3 
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c  |   26 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c |6 
 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c   |   18 +
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c   |   40 +++
 drivers/gpu/drm/amd/amdgpu/soc15.c   |4 
 drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c  |2 
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c |3 
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c |2 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c|   24 ++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c   |9 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c  |   16 +
 drivers/gpu/drm/amd/display/dc/Makefile  |1 
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c   |   20 +
 drivers/gpu/drm/amd/display/dc/core/dc.c |   68 --
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c   |   47 
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c   |   17 +
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.h   |2 
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c|2 
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_init.c  |1 
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c|2 
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c  |2 
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c|2 
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c|  118 ++-
 drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c |   25 --
 drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c   |   21 +
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c  |9 
 drivers/gpu/drm/amd/include/amd_shared.h |2 
 drivers/gpu/drm/amd/include/atomfirmware.h   |   18 +
 drivers/gpu/drm/amd/include/discovery.h  |   38 +++
 drivers/gpu/drm/amd/pm/amdgpu_pm.c   |   11 -
 drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h|5 
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h |5 
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h  |4 
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_ppsmc.h |   16 +
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h |4 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c   |8 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c |2 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c |   54 -
 drivers/gpu/drm/i915/gt/intel_engine_types.h |1 
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c|3 
 drivers/gpu/drm/i915/i915_request.c  |7 
 drivers/gpu/drm/nouveau/dispnv04/crtc.c  |9 
 drivers/gpu/drm/nouveau/nouveau_bo.c |8 
 drivers/gpu/drm/nouveau/nouveau_chan.c   |6 
 drivers/gpu/drm/nouveau/nouveau_dmem.c   |9 
 drivers/gpu/drm/nouveau/nouveau_exec.c   |   11 -
 drivers/gpu/drm/nouveau/nouveau_fence.c  |   32 ++
 drivers/gpu/drm/nouveau/nouveau_fence.h  |5 
 drivers/gpu/drm/nouveau/nouveau_gem.c|5 
 62 files changed, 684 insertions(+), 227 deletions(-)

New commits:
commit 1115578119292161a2bb5fbd3229e1e9b4de4be0
Merge: 25fb9355f855 43ffcd6fa163
Author: Kevin Brace 
Date:   Sat Sep 9 17:38:29 2023 -0700

Merge tag 'drm-next-2023-09-08' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.6

drm fixes for 6.6-rc1

amdgpu:
- Display replay fixes
- Fixes for headless boards
- Fix documentation breakage
- RAS fixes
- Handle newer IP discovery tables
- SMU 13.0.6 fixes
- SR-IOV fixes
- Display vstartup fixes
- NBIO 7.9 fixes

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.6' - 2 commits - drivers/gpu/drm

2023-07-28 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c |2 +-
 drivers/gpu/drm/via/via_drv.h  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 8fbf2fd180941837a0c15389aa875e264ed7c56c
Author: Kevin Brace 
Date:   Fri Jul 28 18:10:39 2023 -0500

drm/via: Version bumped to 3.6.10

Fix a regression of IGA2 screen color depth.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index fed60e2cb2a6..74aa149fea16 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  9
+#define DRIVER_PATCHLEVEL  10
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230726"
+#define DRIVER_DATE"20230728"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 4f2a54ba6a112536cecab21eb20e50071c6c8fb1
Author: Kevin Brace 
Date:   Fri Jul 28 16:12:00 2023 -0500

drm/via: Fix a regression of IGA2 screen color depth

Commit 063554e (drm/via: Modify via_iga*_set_color_depth() input
parameters) change to via_iga2_set_color_depth() missed using its
new cpp parameter inside the function when setting IGA2's BPP
(Bits Per Pixel).  As a result, if the color depth was anything
other than 8-bit (or 8-bit BPP), like 16-bit (16-bit BPP) or
24-bit (32-bit BPP), the screen controlled by IGA2 would have been
corrupted.  This commit fixes this regression.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index b570fd7bdb4b..74537c31e0f0 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -157,7 +157,7 @@ static void via_iga2_set_color_depth(struct drm_device *dev,
data = 0x00;
 
/* Set the color depth for IGA2. */
-   switch (depth) {
+   switch (cpp) {
case 1:
break;
case 2:


[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.6'

2023-07-26 Thread Kevin Brace
New branch 'drm-next-6.6' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.5' - 2 commits - drivers/gpu/drm

2023-07-26 Thread Kevin Brace
 drivers/gpu/drm/via/via_cursor.c |   13 +
 drivers/gpu/drm/via/via_drv.h|4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit cb11d9db71dab54cd0799291b977c251cac42577
Author: Kevin Brace 
Date:   Wed Jul 26 18:02:36 2023 -0500

drm/via: Version bumped to 3.6.9

Improve the cursor plane behavior somewhat.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index b650fb5986e1..fed60e2cb2a6 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  8
+#define DRIVER_PATCHLEVEL  9
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230522"
+#define DRIVER_DATE"20230726"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 25ceadef0072178b7fcca1b64a5a6ef118c97484
Author: Kevin Brace 
Date:   Wed Jul 26 17:57:52 2023 -0500

drm/via: Use atomic_enable callback for the cursor plane

This appears to improve the cursor behavior, but more work is needed to
fix the issue completely.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index 956d53052b78..1132c45ac1c6 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -365,6 +365,18 @@ static void via_cursor_atomic_update(struct drm_plane 
*plane,
via_show_cursor(crtc);
 }
 
+static void via_cursor_atomic_enable(struct drm_plane *plane,
+   struct drm_atomic_state *state)
+{
+   struct drm_plane_state *new_state =
+   drm_atomic_get_new_plane_state(state, plane);
+   struct drm_crtc *crtc = new_state->crtc;
+
+   if (crtc) {
+   via_show_cursor(crtc);
+   }
+}
+
 void via_cursor_atomic_disable(struct drm_plane *plane,
struct drm_atomic_state *state)
 {
@@ -382,6 +394,7 @@ const struct drm_plane_helper_funcs 
via_cursor_drm_plane_helper_funcs = {
.cleanup_fb = via_cursor_cleanup_fb,
.atomic_check   = via_cursor_atomic_check,
.atomic_update  = via_cursor_atomic_update,
+   .atomic_enable  = via_cursor_atomic_enable,
.atomic_disable = via_cursor_atomic_disable,
 };
 


[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.5'

2023-05-22 Thread Kevin Brace
New branch 'drm-next-6.5' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.4' - 4 commits - drivers/gpu/drm

2023-05-22 Thread Kevin Brace
 drivers/gpu/drm/via/via_dac.c |2 +-
 drivers/gpu/drm/via/via_drv.h |7 ---
 drivers/gpu/drm/via/via_encoder.c |2 +-
 drivers/gpu/drm/via/via_hdmi.c|2 +-
 drivers/gpu/drm/via/via_lvds.c|2 +-
 drivers/gpu/drm/via/via_sii164.c  |2 +-
 drivers/gpu/drm/via/via_tmds.c|2 +-
 drivers/gpu/drm/via/via_ttm.c |   12 ++--
 drivers/gpu/drm/via/via_vt1632.c  |2 +-
 9 files changed, 21 insertions(+), 12 deletions(-)

New commits:
commit 0851c8c14568c5b9f82e382bde6af9df8ec64375
Author: Kevin Brace 
Date:   Mon May 22 08:14:00 2023 -0700

drm/via: Version bumped to 3.6.7

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index dad0aeef5824..296672421122 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  6
+#define DRIVER_PATCHLEVEL  7
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230407"
+#define DRIVER_DATE"20230522"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 4acc6cd4c93acff1d8f6f794e4ffde77af56af30
Author: Kevin Brace 
Date:   Mon May 22 08:12:20 2023 -0700

drm/via: Rename via_encoder_cleanup() to via_encoder_destroy()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 94d0c8311431..0ac26da1f798 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -102,7 +102,7 @@ static void via_dac_display_source(struct via_drm_priv 
*dev_priv,
  * Routines for controlling stuff on the DAC port
  */
 static const struct drm_encoder_funcs via_dac_enc_funcs = {
-   .destroy = via_encoder_cleanup,
+   .destroy = via_encoder_destroy,
 };
 
 /*
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 9e9184afa8ec..dad0aeef5824 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -347,7 +347,8 @@ 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);
+
+void via_encoder_destroy(struct drm_encoder *encoder);
 
 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 d7798f2ce5ba..5418a9257bf8 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -222,7 +222,7 @@ 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)
+void via_encoder_destroy(struct drm_encoder *encoder)
 {
struct via_encoder *enc = container_of(encoder, struct via_encoder, 
base);
 
diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index 61dd5549034c..fc4e0a90dd11 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -50,7 +50,7 @@ module_param_named(audio, via_hdmi_audio, int, 0444);
  * Routines for controlling stuff on the HDMI port
  */
 static const struct drm_encoder_funcs via_hdmi_enc_funcs = {
-   .destroy = via_encoder_cleanup,
+   .destroy = via_encoder_destroy,
 };
 
 static void via_hdmi_enc_dpms(struct drm_encoder *encoder, int mode)
diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index c4efef83d3c5..1460be6e079a 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -731,7 +731,7 @@ const struct drm_encoder_helper_funcs via_lvds_helper_funcs 
= {
 };
 
 const struct drm_encoder_funcs via_lvds_enc_funcs = {
-   .destroy = via_encoder_cleanup,
+   .destroy = via_encoder_destroy,
 };
 
 /* Detect FP presence. */
diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index f676b79df1c5..89461b9b7412 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -127,7 +127,7 @@ static void via_sii164_init_registers(struct i2c_adapter 
*i2c_bus)
 
 
 static const struct drm_encoder_funcs via_sii164_drm_encoder_funcs = {
-   .destroy = via_encoder_cleanup,
+   .destroy = via_encoder_destroy,
 };
 
 static void via_sii164_dpms(struct drm_encoder *encoder, int mode)
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index d532c8dfb8db..ed5a8cd55203 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -195,7 +195,7 @@ static void via_tmds_display_source(struct

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.4' - 53 commits - drivers/gpu/drm

2023-05-18 Thread Kevin Brace
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c |   13 
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |   39 
+-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c  |6 
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c |1 
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c |1 
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  |1 
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c |2 
 drivers/gpu/drm/amd/amdgpu/nv.c|   23 -
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c |5 
 drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c|2 
 drivers/gpu/drm/amd/amdgpu/soc15.c |   25 -
 drivers/gpu/drm/amd/amdgpu/soc21.c |   23 -
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   34 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  |1 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c|   17 
 drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c |2 
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c   |5 
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |3 
 drivers/gpu/drm/amd/display/dc/dc.h|1 
 drivers/gpu/drm/amd/display/dc/dc_stream.h |2 
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c|   19 -
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c |9 
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c |   25 +
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c  |4 
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c |4 
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c|2 
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c|2 
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c |1 
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c  |   56 
+--
 drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c|   10 
 drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c   |  178 
+-
 drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c   |   18 -
 drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c |4 
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c   |   17 
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.h   |2 
 drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c |   24 -
 drivers/gpu/drm/amd/display/dc/link/link_dpms.c|5 
 drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c   |5 
 drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c |1 
 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c  |3 
 drivers/gpu/drm/amd/display/include/signal_types.h |1 
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h   |4 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |3 
 drivers/gpu/drm/i915/display/icl_dsi.c |2 
 drivers/gpu/drm/i915/display/intel_dsi_vbt.c   |   11 
 drivers/gpu/drm/i915/display/intel_dsi_vbt.h   |1 
 drivers/gpu/drm/i915/display/skl_scaler.c  |   17 
 drivers/gpu/drm/i915/display/vlv_dsi.c |   22 -
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c   |   20 -
 drivers/gpu/drm/i915/i915_pci.c|2 
 50 files changed, 415 insertions(+), 263 deletions(-)

New commits:
commit dee1b5f74550a1bc6bbc99c6aaf1e363fdab4b6b
Merge: efa0ff28cf70 1bef84af084e
Author: Kevin Brace 
Date:   Thu May 18 18:55:26 2023 -0700

Merge tag 'drm-next-2023-05-05' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.4

drm fixes part 2 for 6.4-rc1

amdgpu:
- SR-IOV fixes
- DCN 3.2 fixes
- DC mclk handling fixes
- eDP fixes
- SubVP fixes
- HDCP regression fix
- DSC fixes
- DC FP fixes
- DCN 3.x fixes
- Display flickering fix when switching between vram and gtt
- Z8 power saving fix
- Fix hang when skipping modeset
- GPU reset fixes
- Doorbell fix when resizing BARs
- Fix spurious warnings in gmc
- Locking fix for AMDGPU_SCHED IOCTL
- SR-IOV fix
- DCN 3.1.4 fix
- DCN 3.2 fix
- Fix job cleanup when CS is aborted

i915:
- skl pipe source size check
- mtl

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.4' - 7 commits - drivers/accel/qaic drivers/gpu/drm

2023-04-27 Thread Kevin Brace
 drivers/accel/qaic/Makefile  |1 
 drivers/accel/qaic/mhi_qaic_ctrl.c   |  569 ---
 drivers/accel/qaic/mhi_qaic_ctrl.h   |   12 
 drivers/accel/qaic/qaic_drv.c|   10 
 drivers/gpu/drm/panel/panel-novatek-nt35950.c|   10 
 drivers/gpu/drm/panel/panel-orisetech-otm8009a.c |2 
 drivers/gpu/drm/ttm/ttm_pool.c   |   30 -
 7 files changed, 21 insertions(+), 613 deletions(-)

New commits:
commit efa0ff28cf703b6415c6d4214c3c93074e501189
Merge: 05d524ffba98 cf03e2956af3
Author: Kevin Brace 
Date:   Thu Apr 27 11:21:56 2023 -0700

Merge tag 'drm-next-2023-04-27' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.4

drm-next fixes for 6.4-rc1

ttm:
- Fix TTM build on archs where PMD_SHIFT is not constant.

qaic:
- Revert uAPI from accel/qaic.

panel:
- Improve error handling in nt35950.
- Fix double unregister in otm8009a when removing the driver.

commit cf03e2956af307dc25e8c41fd4cffe44482a6ec1
Merge: 289af45508ca a50be876f4fe
Author: Dave Airlie 
Date:   Thu Apr 27 11:29:33 2023 +1000

Merge tag 'drm-misc-next-fixes-2023-04-26' of 
git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next-fixes for v6.4-rc1:
- Revert uAPI from accel/qaic.
- Fix TTM build on archs where PMD_SHIFT is not constant.
- Improve error handling in nt35950.
- Fix double unregister in otm8009a when removing the driver.

Signed-off-by: Dave Airlie 
From: Maarten Lankhorst 
Link: 
https://patchwork.freedesktop.org/patch/msgid/45757de9-75d8-5b41-f1f9-562a7c467...@linux.intel.com

commit a50be876f4fe2349dc8b056a49d87f69c944570f
Author: Konrad Dybcio 
Date:   Mon Apr 17 17:41:08 2023 +0200

drm/panel: novatek-nt35950: Only unregister DSI1 if it exists

Commit 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
introduced logic to unregister DSI1 on any sort of probe failure, as
that's not done automatically by kernel APIs.

It did not however account for cases where only one DSI host is used.
Fix that.

Fixes: 5dd45b66742a ("drm/panel: novatek-nt35950: Improve error handling")
Reported-by: AngeloGioacchino Del Regno 

Signed-off-by: Konrad Dybcio 
Reviewed-by: AngeloGioacchino Del Regno 

Signed-off-by: Neil Armstrong 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20230417-topic-maple_panel_fixup-v1-1-07c8db606...@linaro.org

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35950.c 
b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
index 7498fc6258bb..8b108ac80b55 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt35950.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt35950.c
@@ -586,7 +586,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
 
ret = drm_panel_of_backlight(>panel);
if (ret) {
-   mipi_dsi_device_unregister(nt->dsi[1]);
+   if (num_dsis == 2)
+   mipi_dsi_device_unregister(nt->dsi[1]);
 
return dev_err_probe(dev, ret, "Failed to get backlight\n");
}
@@ -606,7 +607,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
ret = mipi_dsi_attach(nt->dsi[i]);
if (ret < 0) {
/* If we fail to attach to either host, we're done */
-   mipi_dsi_device_unregister(nt->dsi[1]);
+   if (num_dsis == 2)
+   mipi_dsi_device_unregister(nt->dsi[1]);
 
return dev_err_probe(dev, ret,
 "Cannot attach to DSI%d host.\n", 
i);
commit ab4f869fba6119997f7630d600049762a2b014fa
Author: James Cowgill 
Date:   Wed Apr 12 17:35:07 2023 +

drm/panel: otm8009a: Set backlight parent to panel device

This is the logical place to put the backlight device, and it also
fixes a kernel crash if the MIPI host is removed. Previously the
backlight device would be unregistered twice when this happened - once
as a child of the MIPI host through `mipi_dsi_host_unregister`, and
once when the panel device is destroyed.

Fixes: 12a6cbd4f3f1 ("drm/panel: otm8009a: Use new backlight API")
Signed-off-by: James Cowgill 
Cc: sta...@vger.kernel.org
Reviewed-by: Neil Armstrong 
Signed-off-by: Neil Armstrong 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20230412173450.199592-1-james.cowg...@blaize.com

diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c 
b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
index b4729a94c34a..898b892f1143 100644
--- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
+++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
@@ -471,7 +471,7 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
   DRM_MODE

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.4' - 4 commits - drivers/gpu/drm

2023-04-07 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c   |4 +---
 drivers/gpu/drm/via/via_cursor.c |2 +-
 drivers/gpu/drm/via/via_drv.h|2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 6a66b47f0b6a14b549ea9a760cb5093539eb8f85
Author: Kevin Brace 
Date:   Fri Apr 7 18:35:03 2023 -0700

drm/via: Version bumped to 3.6.6

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 83f2d05c7fe8..9e9184afa8ec 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,7 +44,7 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  5
+#define DRIVER_PATCHLEVEL  6
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
 #define DRIVER_DATE"20230407"
commit cf3b8ddefc21f8398645184b8e11c02b3451cf68
Author: Kevin Brace 
Date:   Fri Apr 7 18:31:48 2023 -0700

drm/via: Replace DRM_FORMAT_RGB332 with DRM_FORMAT_C8 for 8-bit color

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 00271bbb4910..16377e6d840f 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -2234,7 +2234,7 @@ exit:
 static const uint32_t via_primary_formats[] = {
DRM_FORMAT_XRGB,
DRM_FORMAT_RGB565,
-   DRM_FORMAT_RGB332,
+   DRM_FORMAT_C8,
 };
 
 int via_crtc_init(struct via_drm_priv *dev_priv, uint32_t index)
commit 3281a7713ba288b49346e8a83b35ce1f3e0c6cec
Author: Kevin Brace 
Date:   Fri Apr 7 18:31:46 2023 -0700

drm/via: Delete several primary plane format types

Remove DRM_FORMAT_ARGB and DRM_FORMAT_RGB888 from the list.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index e5d1fa742a6a..00271bbb4910 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -2233,8 +2233,6 @@ exit:
 
 static const uint32_t via_primary_formats[] = {
DRM_FORMAT_XRGB,
-   DRM_FORMAT_ARGB,
-   DRM_FORMAT_RGB888,
DRM_FORMAT_RGB565,
DRM_FORMAT_RGB332,
 };
commit e8f1b49a3c20099671b555817e0148cd0b54d82d
Author: Kevin Brace 
Date:   Fri Apr 7 18:31:45 2023 -0700

drm/via: Use DRM_FORMAT_XRGB format for cursor plane

This is for HI (Hardware Icon) based cursor plane code.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index 5d25d3a4fc77..a7815c120a5d 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -394,7 +394,7 @@ const struct drm_plane_funcs via_cursor_drm_plane_funcs = {
 };
 
 const uint32_t via_cursor_formats[] = {
-   DRM_FORMAT_ARGB,
+   DRM_FORMAT_XRGB,
 };
 
 const unsigned int via_cursor_formats_size =


[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.4'

2023-04-07 Thread Kevin Brace
New branch 'drm-next-6.4' available with the following commits:


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

2023-04-07 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c |   97 +++--
 drivers/gpu/drm/via/via_drv.h  |4 -
 2 files changed, 48 insertions(+), 53 deletions(-)

New commits:
commit c5310698f976f4761302669adbf427c35c9141cb
Author: Kevin Brace 
Date:   Fri Apr 7 18:21:27 2023 -0700

drm/via: Version bumped to 3.6.5

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index bcc0a75a0002..83f2d05c7fe8 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  4
+#define DRIVER_PATCHLEVEL  5
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230224"
+#define DRIVER_DATE"20230407"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 98f321e117ea57d62d031b64364df8e39645c37b
Author: Kevin Brace 
Date:   Fri Apr 7 18:21:25 2023 -0700

drm/via: Adjust CRTC pitch calculation and indentation

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 0db78cf0ea98..e5d1fa742a6a 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1929,8 +1929,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
vga_wcrt(VGABASE, 0x34, (addr >> 16) & 0xFF);
 
/* Load fetch count registers */
-   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0],
-   16);
+   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
load_value_to_registers(VGABASE, >fetch, pitch >> 4);
 
/* Set the primary pitch */
@@ -1956,7 +1955,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
svga_wcrt_mask(VGABASE, 0xA3, ((addr >> 26) & 0x07), 0x07);
 
/* Load fetch count registers */
-   pitch = ALIGN(crtc->mode.hdisplay * (fb->format->cpp[0] * 8) >> 
3, 16);
+   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
load_value_to_registers(VGABASE, >fetch, pitch >> 4);
 
/* Set secondary pitch */
commit 063554e3edc04b77a33210d9b4c5feb9ebe1c7aa
Author: Kevin Brace 
Date:   Fri Apr 7 18:18:21 2023 -0700

drm/via: Modify via_iga*_set_color_depth() input parameters

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 8a4db7ef585a..0db78cf0ea98 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -106,86 +106,78 @@ static void via_iga_common_init(struct drm_device *dev)
 }
 
 static void via_iga1_set_color_depth(struct drm_device *dev,
-   u8 depth)
+   u8 cpp, u8 depth)
 {
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-   u8 value;
+   u8 data;
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   value = 0x00;
+   data = 0x00;
 
/* Set the color depth for IGA1. */
-   switch (depth) {
-   case 8:
+   switch (cpp) {
+   case 1:
+   data |= BIT(4);
break;
-   case 16:
-   /* Bit 4 is for 555 (15-bit) / 565 (16-bit) color selection. */
-   value |= BIT(4) | BIT(2);
+   case 2:
+   data = (depth == 15) ? BIT(2) : BIT(4) | BIT(2);
break;
-   case 24:
-   value |= BIT(3) | BIT(2);
+   case 4:
+   data = (depth == 30) ? BIT(3) : BIT(3) | BIT(2);
+   data |= BIT(4);
break;
default:
break;
}
 
-   if ((depth == 8) || (depth == 16) || (depth == 24)) {
-   /* 3C5.15[4]   - Hi Color Mode Select
-*   0: 555
-*   1: 565
-* 3C5.15[3:2] - Display Color Depth Select
-*   00: 8bpp
-*   01: 16bpp
-*   10: 30bpp
-*   11: 32bpp */
-   svga_wseq_mask(VGABASE, 0x15, value,
-   BIT(4) | BIT(3) | BIT(2));
-   DRM_INFO("IGA1 Color Depth: %d bit\n", depth);
-   } else {
-   DRM_ERROR("Unsupported IGA1 Color Depth: %d bit\n",
-   depth);
-   }
+   /*
+* 3C5.15[4]   - Hi Color Mode Select
+*   0: 555
+*   1: 565
+* 3C5.15[3:2] - Display Color Depth Select
+*   00: 8bpp
+* 

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 0 commits -

2023-04-07 Thread Kevin Brace
Rebased ref, commits from common ancestor:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 7 commits - drivers/gpu/drm

2023-04-07 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c |  132 -
 drivers/gpu/drm/via/via_dac.c  |3 
 drivers/gpu/drm/via/via_drv.h  |4 -
 drivers/gpu/drm/via/via_lvds.c |   35 +++---
 drivers/gpu/drm/via/via_tmds.c |6 -
 5 files changed, 80 insertions(+), 100 deletions(-)

New commits:
commit 8ce5bb858db868107c2debeee9d644661d37af24
Author: Kevin Brace 
Date:   Fri Apr 7 17:30:08 2023 -0700

drm/via: Version bumped to 3.6.5

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index bcc0a75a0002..83f2d05c7fe8 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  4
+#define DRIVER_PATCHLEVEL  5
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230224"
+#define DRIVER_DATE"20230407"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 32747efa49262b344a0fa20b566d5905ee08940b
Author: Kevin Brace 
Date:   Fri Apr 7 17:26:25 2023 -0700

drm/via: Adjust CRTC pitch calculation and indentation

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 0db78cf0ea98..e5d1fa742a6a 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1929,8 +1929,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
vga_wcrt(VGABASE, 0x34, (addr >> 16) & 0xFF);
 
/* Load fetch count registers */
-   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0],
-   16);
+   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
load_value_to_registers(VGABASE, >fetch, pitch >> 4);
 
/* Set the primary pitch */
@@ -1956,7 +1955,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
svga_wcrt_mask(VGABASE, 0xA3, ((addr >> 26) & 0x07), 0x07);
 
/* Load fetch count registers */
-   pitch = ALIGN(crtc->mode.hdisplay * (fb->format->cpp[0] * 8) >> 
3, 16);
+   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
load_value_to_registers(VGABASE, >fetch, pitch >> 4);
 
/* Set secondary pitch */
commit 22828197acd329f3a4a7a2ec345d2f3c4d331e66
Author: Kevin Brace 
Date:   Fri Apr 7 17:25:49 2023 -0700

drm/via: Modify via_iga*_set_color_depth() parameters

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 8a4db7ef585a..0db78cf0ea98 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -106,86 +106,78 @@ static void via_iga_common_init(struct drm_device *dev)
 }
 
 static void via_iga1_set_color_depth(struct drm_device *dev,
-   u8 depth)
+   u8 cpp, u8 depth)
 {
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-   u8 value;
+   u8 data;
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   value = 0x00;
+   data = 0x00;
 
/* Set the color depth for IGA1. */
-   switch (depth) {
-   case 8:
+   switch (cpp) {
+   case 1:
+   data |= BIT(4);
break;
-   case 16:
-   /* Bit 4 is for 555 (15-bit) / 565 (16-bit) color selection. */
-   value |= BIT(4) | BIT(2);
+   case 2:
+   data = (depth == 15) ? BIT(2) : BIT(4) | BIT(2);
break;
-   case 24:
-   value |= BIT(3) | BIT(2);
+   case 4:
+   data = (depth == 30) ? BIT(3) : BIT(3) | BIT(2);
+   data |= BIT(4);
break;
default:
break;
}
 
-   if ((depth == 8) || (depth == 16) || (depth == 24)) {
-   /* 3C5.15[4]   - Hi Color Mode Select
-*   0: 555
-*   1: 565
-* 3C5.15[3:2] - Display Color Depth Select
-*   00: 8bpp
-*   01: 16bpp
-*   10: 30bpp
-*   11: 32bpp */
-   svga_wseq_mask(VGABASE, 0x15, value,
-   BIT(4) | BIT(3) | BIT(2));
-   DRM_INFO("IGA1 Color Depth: %d bit\n", depth);
-   } else {
-   DRM_ERROR("Unsupported IGA1 Color Depth: %d bit\n",
-   depth);
-   }
+   /*
+* 3C5.15[4]   - Hi Color Mode Select
+*  

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 0 commits -

2023-04-07 Thread Kevin Brace
Rebased ref, commits from common ancestor:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.4' - 0 commits -

2023-04-07 Thread Kevin Brace
Rebased ref, commits from common ancestor:


[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.4'

2023-04-07 Thread Kevin Brace
New branch 'drm-next-6.4' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 7 commits - drivers/gpu/drm

2023-04-07 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c |  132 -
 drivers/gpu/drm/via/via_dac.c  |3 
 drivers/gpu/drm/via/via_drv.h  |4 -
 drivers/gpu/drm/via/via_lvds.c |   35 +++---
 drivers/gpu/drm/via/via_tmds.c |6 -
 5 files changed, 80 insertions(+), 100 deletions(-)

New commits:
commit fdc2b68f1b57149ef7ee1f925509939e192d202b
Author: Kevin Brace 
Date:   Fri Apr 7 12:22:30 2023 -0700

drm/via: Version bumped to 3.6.5

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index bcc0a75a0002..83f2d05c7fe8 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  4
+#define DRIVER_PATCHLEVEL  5
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230224"
+#define DRIVER_DATE"20230407"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 49f084322986bcd714a80323f6d68b6209989408
Author: Kevin Brace 
Date:   Fri Apr 7 12:17:48 2023 -0700

drm/via: Adjust CRTC pitch calculation and indentation

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 0db78cf0ea98..e5d1fa742a6a 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1929,8 +1929,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
vga_wcrt(VGABASE, 0x34, (addr >> 16) & 0xFF);
 
/* Load fetch count registers */
-   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0],
-   16);
+   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
load_value_to_registers(VGABASE, >fetch, pitch >> 4);
 
/* Set the primary pitch */
@@ -1956,7 +1955,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
svga_wcrt_mask(VGABASE, 0xA3, ((addr >> 26) & 0x07), 0x07);
 
/* Load fetch count registers */
-   pitch = ALIGN(crtc->mode.hdisplay * (fb->format->cpp[0] * 8) >> 
3, 16);
+   pitch = ALIGN(crtc->mode.hdisplay * fb->format->cpp[0], 16);
load_value_to_registers(VGABASE, >fetch, pitch >> 4);
 
/* Set secondary pitch */
commit 17a1877a658bf132f812c575d545129f934975b8
Author: Kevin Brace 
Date:   Fri Apr 7 12:17:47 2023 -0700

drm/via: Modify via_iga*_set_color_depth() parameters

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 8a4db7ef585a..0db78cf0ea98 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -106,86 +106,78 @@ static void via_iga_common_init(struct drm_device *dev)
 }
 
 static void via_iga1_set_color_depth(struct drm_device *dev,
-   u8 depth)
+   u8 cpp, u8 depth)
 {
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
-   u8 value;
+   u8 data;
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   value = 0x00;
+   data = 0x00;
 
/* Set the color depth for IGA1. */
-   switch (depth) {
-   case 8:
+   switch (cpp) {
+   case 1:
+   data |= BIT(4);
break;
-   case 16:
-   /* Bit 4 is for 555 (15-bit) / 565 (16-bit) color selection. */
-   value |= BIT(4) | BIT(2);
+   case 2:
+   data = (depth == 15) ? BIT(2) : BIT(4) | BIT(2);
break;
-   case 24:
-   value |= BIT(3) | BIT(2);
+   case 4:
+   data = (depth == 30) ? BIT(3) : BIT(3) | BIT(2);
+   data |= BIT(4);
break;
default:
break;
}
 
-   if ((depth == 8) || (depth == 16) || (depth == 24)) {
-   /* 3C5.15[4]   - Hi Color Mode Select
-*   0: 555
-*   1: 565
-* 3C5.15[3:2] - Display Color Depth Select
-*   00: 8bpp
-*   01: 16bpp
-*   10: 30bpp
-*   11: 32bpp */
-   svga_wseq_mask(VGABASE, 0x15, value,
-   BIT(4) | BIT(3) | BIT(2));
-   DRM_INFO("IGA1 Color Depth: %d bit\n", depth);
-   } else {
-   DRM_ERROR("Unsupported IGA1 Color Depth: %d bit\n",
-   depth);
-   }
+   /*
+* 3C5.15[4]   - Hi Color Mode Select
+*  

[openchrome-devel] xf86-video-openchrome: Branch 'main' - src/via_dmabuffer.h

2023-03-28 Thread Kevin Brace
 src/via_dmabuffer.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 857d892b668b4737d41ef1b7f58fd45eac84d552
Author: Kevin Brace 
Date:   Tue Mar 28 13:10:39 2023 -0700

Use HALCYON_HEADER1 constant for H1_ADDR function macro

Signed-off-by: Kevin Brace 

diff --git a/src/via_dmabuffer.h b/src/via_dmabuffer.h
index 2f3a640..5862bde 100644
--- a/src/via_dmabuffer.h
+++ b/src/via_dmabuffer.h
@@ -53,7 +53,7 @@ typedef struct _ViaCommandBuffer
 (cb)->waitFlags |= (flags)
 
 #define H1_ADDR(val) \
-(((val) >> 2) | 0xF000)
+(((val) >> 2) | HALCYON_HEADER1)
 
 #define OUT_RING(val)   \
 do {\


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 7 commits - configure.ac src/via_3d.c src/via_3d.h src/via_dmabuffer.h src/via_exa.c src/via_exa_h2.c src/via_exa_h6.c

2023-03-22 Thread Kevin Brace
 configure.ac|2 -
 src/via_3d.c|   14 +---
 src/via_3d.h|   37 --
 src/via_dmabuffer.h |   86 +++-
 src/via_exa.c   |   26 +--
 src/via_exa_h2.c|   14 
 src/via_exa_h6.c|8 ++--
 7 files changed, 96 insertions(+), 91 deletions(-)

New commits:
commit 40a341dc8aaeba1150f8bde43e4e33e506baf75d
Author: Kevin Brace 
Date:   Wed Mar 22 14:41:42 2023 -0700

Version bumped to 0.6.604

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 7c1156d..e9b6288 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.603],
+[0.6.604],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit a9db260ea45f0e9cb32cb9b1b4bb0f5c273916fb
Author: Kevin Brace 
Date:   Wed Mar 22 14:40:57 2023 -0700

Remove ScrnInfoPtr pScrn from ViaCommandBuffer{}

Signed-off-by: Kevin Brace 

diff --git a/src/via_3d.c b/src/via_3d.c
index e2d04ff..65afd5a 100644
--- a/src/via_3d.c
+++ b/src/via_3d.c
@@ -277,8 +277,9 @@ via3DOpSupported(CARD8 op)
 }
 
 static void
-via3DEmitQuad(Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY,
-  int src0X, int src0Y, int src1X, int src1Y, int w, int h)
+via3DEmitQuad(VIAPtr pVia,
+Via3DState * v3d, ViaCommandBuffer * cb, int dstX, int dstY,
+int src0X, int src0Y, int src1X, int src1Y, int w, int h)
 {
 CARD32 acmd;
 float dx1, dx2, dy1, dy2, sx1[2], sx2[2], sy1[2], sy2[2], wf;
@@ -384,7 +385,9 @@ via3DEmitQuad(Via3DState * v3d, ViaCommandBuffer * cb, int 
dstX, int dstY,
 }
 
 static void
-via3DEmitState(Via3DState * v3d, ViaCommandBuffer * cb, Bool forceUpload)
+via3DEmitState(VIAPtr pVia,
+Via3DState * v3d, ViaCommandBuffer * cb,
+Bool forceUpload)
 {
 int i;
 Bool saveHas3dState;
@@ -532,8 +535,9 @@ via3DEmitState(Via3DState * v3d, ViaCommandBuffer * cb, 
Bool forceUpload)
  * has3dState flag afterwards.
  */
 static void
-via3DEmitClipRect(Via3DState * v3d, ViaCommandBuffer * cb, int x, int y,
-  int w, int h)
+via3DEmitClipRect(VIAPtr pVia,
+Via3DState * v3d, ViaCommandBuffer * cb,
+int x, int y, int w, int h)
 {
 Bool saveHas3dState;
 
diff --git a/src/via_3d.h b/src/via_3d.h
index 0e87e66..f0a5c68 100644
--- a/src/via_3d.h
+++ b/src/via_3d.h
@@ -30,6 +30,8 @@
 
 #define VIA_NUM_TEXUNITS 2
 
+typedef struct _VIA VIARec, *VIAPtr;
+
 typedef enum
 {
 via_single,
@@ -106,12 +108,15 @@ typedef struct _Via3DState
 CARD32 color);
 void (*setCompositeOperator) (struct _Via3DState * v3d, CARD8 op);
 Bool(*opSupported) (CARD8 op);
-void (*emitQuad) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
-int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y, int w,
-int h);
-void (*emitState) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
+void (*emitQuad) (VIAPtr pVia,
+struct _Via3DState * v3d, ViaCommandBuffer * cb,
+int dstX, int dstY, int src0X, int src0Y, int src1X, int src1Y,
+int w, int h);
+void (*emitState) (VIAPtr pVia,
+struct _Via3DState * v3d, ViaCommandBuffer * cb,
 Bool forceUpload);
-void (*emitClipRect) (struct _Via3DState * v3d, ViaCommandBuffer * cb,
+void (*emitClipRect) (VIAPtr pVia,
+struct _Via3DState * v3d, ViaCommandBuffer * cb,
 int x, int y, int w, int h);
 Bool(*dstSupported) (int format);
 Bool(*texSupported) (int format);
diff --git a/src/via_dmabuffer.h b/src/via_dmabuffer.h
index 92106c8..2f3a640 100644
--- a/src/via_dmabuffer.h
+++ b/src/via_dmabuffer.h
@@ -26,9 +26,10 @@
 
 #include "via_3d_reg.h"
 
+typedef struct _VIA VIARec, *VIAPtr;
+
 typedef struct _ViaCommandBuffer
 {
-ScrnInfoPtr pScrn;
 CARD32 *buf;
 CARD32 waitFlags;
 unsigned pos;
@@ -37,7 +38,7 @@ typedef struct _ViaCommandBuffer
 int header_start;
 int rindex;
 Bool has3dState;
-void (*flushFunc) (struct _ViaCommandBuffer * cb);
+void (*flushFunc) (VIAPtr pVia, struct _ViaCommandBuffer * cb);
 } ViaCommandBuffer;
 
 #define VIA_DMASIZE 16384
@@ -46,7 +47,7 @@ typedef struct _ViaCommandBuffer
 ViaCommandBuffer *cb = >cb
 
 #define ADVANCE_RING\
-cb->flushFunc(cb)
+cb->flushFunc(pVia, cb)
 
 #define WAITFLAGS(flags)\
 (cb)->waitFlags |= (flags)
@@ -74,7 +75,7 @@ typedef struct _ViaCommandBuffer
 #define BEGIN_RING(size)\
 do {\
 if (cb->flushFunc && (cb->pos > (cb->bufSize-(size {\
-cb->flushFunc(cb);  

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 50 commits - drivers/gpu/drm include/uapi/drm

2023-03-03 Thread Kevin Brace
 drivers/gpu/drm/amd/amdgpu/Kconfig |1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c   |3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c|   14 
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h|2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c|1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c|   11 
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c|6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c|   23 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h|3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c |   23 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c|4 
 drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h|2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c   |3 
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c |   83 ++--
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c |1 
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c |1 
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  |3 
 drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c |5 
 drivers/gpu/drm/amd/amdgpu/umc_v8_10.c |  202 
--
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c  |   25 -
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  |5 
 drivers/gpu/drm/amd/amdkfd/kfd_events.c|9 
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c   |   15 
 drivers/gpu/drm/amd/display/Kconfig|1 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   16 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c  |2 
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c|6 
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c |3 
 drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c |5 
 drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.h   |1 
 drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c |2 
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c  |   15 
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c |4 
 drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c |4 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |   25 -
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c   |1 
 drivers/gpu/drm/drm_gem_shmem_helper.c |2 
 drivers/gpu/drm/i915/Kconfig   |6 
 drivers/gpu/drm/i915/display/intel_quirks.c|2 
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c |5 
 drivers/gpu/drm/i915/gt/intel_ring.c   |6 
 drivers/gpu/drm/i915/gvt/debugfs.c |   16 
 drivers/gpu/drm/i915/gvt/firmware.c|2 
 drivers/gpu/drm/i915/gvt/kvmgt.c   |2 
 drivers/gpu/drm/i915/gvt/vgpu.c|2 
 drivers/gpu/drm/msm/msm_fbdev.c|2 
 drivers/gpu/drm/omapdrm/omap_fbdev.c   |2 
 drivers/gpu/drm/radeon/atombios_encoders.c |5 
 include/uapi/drm/amdgpu_drm.h  |   11 
 50 files changed, 446 insertions(+), 149 deletions(-)

New commits:
commit 900683a27ba2a5ddf550d43bca5d6bec4deca1f3
Merge: 48a683e84412 54ceb92724a8
Author: Kevin Brace 
Date:   Fri Mar 3 13:33:16 2023 -0800

Merge tag 'drm-next-2023-03-03' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.3

drm fixes for rc1

fbdev:
- fix uninit var in error path

shmem:
- revert unGPLing an export

i915:
- Don't use stolen memory or BAR mappings for ring buffers with LLC
- Add inverted backlight quirk for HP 14-r206nv
- Fix GSI offset for MCR lookups
- GVT fixes (memleak, debugfs attributes, kconfig, typos)

amdgpu:
- SMU 13 fixes
- Enable TMZ for GC 10.3.6
- Misc display fixes
- Buddy allocator fixes
- GC 11 fixes
- S0ix fix
- INFO IOCTL queries for GC 11
- VCN harvest fixes for SR-IOV
- UMC 8.10 RAS fixes
- Don't restrict bpc to 8
- NBIO 7.5 fix
- Allow freesync on PCon for more devices

amdkfd:
- SDMA fix
- Illegal memory access fix

radeon:
- Display fix for iMac11,2

commit 54ceb92724a8cf5294c284d5e9f770fc763cdab2
Merge

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - drivers/gpu/drm

2023-02-25 Thread Kevin Brace
 drivers/gpu/drm/Kconfig  |4 ++--
 drivers/gpu/drm/Makefile |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit def9735446156fd21368dec5de8b80be9a8ac046
Author: Kevin Brace 
Date:   Fri Feb 24 10:42:45 2023 -0800

drm/via: Adjust DRM Kconfig and Makefile for OpenChrome

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index bd79b5323275..41ec6c20e544 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -239,8 +239,6 @@ source "drivers/gpu/drm/amd/amdgpu/Kconfig"
 
 source "drivers/gpu/drm/nouveau/Kconfig"
 
-source "drivers/gpu/drm/via/Kconfig"
-
 source "drivers/gpu/drm/i915/Kconfig"
 
 source "drivers/gpu/drm/kmb/Kconfig"
@@ -276,6 +274,8 @@ source "drivers/gpu/drm/vmwgfx/Kconfig"
 
 source "drivers/gpu/drm/gma500/Kconfig"
 
+source "drivers/gpu/drm/via/Kconfig"
+
 source "drivers/gpu/drm/udl/Kconfig"
 
 source "drivers/gpu/drm/ast/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 60614f879a0d..cbbdd7087c8e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -148,13 +148,13 @@ obj-$(CONFIG_DRM_VC4)  += vc4/
 obj-$(CONFIG_DRM_SIS)   += sis/
 obj-$(CONFIG_DRM_SAVAGE)+= savage/
 obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
-obj-$(CONFIG_DRM_VIA)  += via/
 obj-$(CONFIG_DRM_VGEM) += vgem/
 obj-$(CONFIG_DRM_VKMS) += vkms/
 obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
 obj-$(CONFIG_DRM_EXYNOS) +=exynos/
 obj-$(CONFIG_DRM_ROCKCHIP) +=rockchip/
 obj-$(CONFIG_DRM_GMA500) += gma500/
+obj-$(CONFIG_DRM_VIA) += via/
 obj-$(CONFIG_DRM_UDL) += udl/
 obj-$(CONFIG_DRM_AST) += ast/
 obj-$(CONFIG_DRM_ARMADA) += armada/


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 5 commits - drivers/gpu/drm

2023-02-25 Thread Kevin Brace
 drivers/gpu/drm/via/via_cursor.c |   18 +-
 drivers/gpu/drm/via/via_drv.c|1 -
 drivers/gpu/drm/via/via_drv.h|4 ++--
 drivers/gpu/drm/via/via_i2c.c|   15 +++
 drivers/gpu/drm/via/via_lvds.c   |3 +++
 5 files changed, 17 insertions(+), 24 deletions(-)

New commits:
commit 8a681dc487ab446eea53ceb0ea2b154638402d2b
Author: Kevin Brace 
Date:   Fri Feb 24 10:35:45 2023 -0800

drm/via: Version bumped to 3.6.4

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 2f916891dbd0..380cbffc88f9 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  3
+#define DRIVER_PATCHLEVEL  4
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230201"
+#define DRIVER_DATE"20230224"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 5de9451192b8f69c4bf233aab8b34cd7e7fa023e
Author: Kevin Brace 
Date:   Fri Feb 24 10:33:02 2023 -0800

drm/via: Remove excess kernel logging when displaying the cursor

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index 9a0c1fd9ff1c..ac7a8c475623 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -259,8 +259,6 @@ static int via_cursor_prepare_fb(struct drm_plane *plane,
struct via_bo *bo;
int ret = 0;
 
-   DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
if (!new_state->fb) {
goto exit;
}
@@ -282,7 +280,6 @@ static int via_cursor_prepare_fb(struct drm_plane *plane,
}
 
 exit:
-   DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
 }
 
@@ -294,8 +291,6 @@ static void via_cursor_cleanup_fb(struct drm_plane *plane,
struct via_bo *bo;
int ret;
 
-   DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
if (!old_state->fb) {
goto exit;
}
@@ -314,7 +309,7 @@ static void via_cursor_cleanup_fb(struct drm_plane *plane,
ttm_bo_unreserve(ttm_bo);
 
 exit:
-   DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+   return;
 }
 
 static int via_cursor_atomic_check(struct drm_plane *plane,
@@ -326,8 +321,6 @@ static int via_cursor_atomic_check(struct drm_plane *plane,
struct drm_framebuffer *fb = new_plane_state->fb;
int ret = 0;
 
-   DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
if ((!new_plane_state->crtc) || (!new_plane_state->visible)) {
goto exit;
}
@@ -348,7 +341,6 @@ static int via_cursor_atomic_check(struct drm_plane *plane,
DRM_PLANE_NO_SCALING,
true, true);
 exit:
-   DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
 }
 
@@ -363,8 +355,6 @@ static void via_cursor_atomic_update(struct drm_plane 
*plane,
struct drm_gem_object *gem;
struct ttm_buffer_object *ttm_bo;
 
-   DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
if (new_state->fb != old_state->fb) {
gem = new_state->fb->obj[0];
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
@@ -373,8 +363,6 @@ static void via_cursor_atomic_update(struct drm_plane 
*plane,
 
via_set_hi_location(crtc, new_state->crtc_x, new_state->crtc_y);
via_show_cursor(crtc);
-
-   DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
 void via_cursor_atomic_disable(struct drm_plane *plane,
@@ -384,13 +372,9 @@ void via_cursor_atomic_disable(struct drm_plane *plane,
drm_atomic_get_new_plane_state(state, plane);
struct drm_crtc *crtc = new_state->crtc;
 
-   DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
if (crtc) {
via_hide_cursor(crtc);
}
-
-   DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
 const struct drm_plane_helper_funcs via_cursor_drm_plane_helper_funcs = {
commit b38fcaa39d6fd9ae9e9fd633210e39e661beb674
Author: Kevin Brace 
Date:   Fri Feb 24 10:30:45 2023 -0800

drm/via: Stop including linux/via_i2c.h

Copy some code from it into via_i2c.c.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_i2c.c b/drivers/gpu/drm/via/via_i2c.c
index c52e9a77a547..c87b46941420 100644
--- a/drivers/gpu/drm/via/via_i2c.c
+++ b/drivers/gpu/drm/via/via_i2c.c
@@ -16,13 +16,16 @@
 
 #include "via_drv.h"
 
-enum viafb_i2c_adap;
-
-#include 
-
 #define SERIAL 0
 #defineGPIO1
 
+struct via_i2c_stuff {
+   u16 i2c_port;   /* GPIO or I2

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 4 commits - drivers/gpu/drm

2023-02-02 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c |   99 -
 drivers/gpu/drm/via/via_drv.h  |   27 ---
 2 files changed, 52 insertions(+), 74 deletions(-)

New commits:
commit 87476556ecec4c2576762467f48d6ebeca6bcdba
Author: Kevin Brace 
Date:   Wed Feb 1 20:53:07 2023 -0800

drm/via: Version bumped to 3.6.3

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index d15325d24d5e..2f916891dbd0 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -44,10 +44,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  2
+#define DRIVER_PATCHLEVEL  3
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20230112"
+#define DRIVER_DATE"20230201"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 86057a53419e51a3f1688a5fea02cdcfb3a42de9
Author: Kevin Brace 
Date:   Wed Feb 1 20:45:03 2023 -0800

drm/via: Delete via_lock_crtc()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index b5e23e9f296e..faaac0566119 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1730,9 +1730,6 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
}
}
 
-   /* Relock */
-   via_lock_crtc(VGABASE);
-
if (!iga->index) {
/* Set non-interlace / interlace mode. */
via_iga1_set_interlace_mode(VGABASE,
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 8002acc08fec..d15325d24d5e 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -30,8 +30,6 @@
 #define _VIA_DRV_H
 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -304,13 +302,6 @@ struct via_drm_priv {
 #define VGABASE (VIA_BASE+VIA_MMIO_VGABASE)
 
 
-static inline void
-via_lock_crtc(void __iomem *regs)
-{
-   svga_wcrt_mask(regs, 0x11, BIT(7), BIT(7));
-}
-
-
 extern int via_driver_num_ioctls;
 
 extern struct ttm_device_funcs via_bo_driver;
commit 33c3b32e4ed3df082acb06df2a1a15fa43dc
Author: Kevin Brace 
Date:   Wed Feb 1 20:44:11 2023 -0800

drm/via: Delete via_unlock_crtc()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 2b37ab23a63f..b5e23e9f296e 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1601,8 +1601,20 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
/* Load standard registers */
via_load_vpit_regs(dev_priv);
 
-   /* Unlock */
-   via_unlock_crtc(VGABASE, pdev->device);
+   /*
+* For VX855 and VX900 chipsets, CRTC unlock register is
+* CR47[4].  For all others, CR47[0].
+*/
+   if ((pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HCM) ||
+   (pdev->device == PCI_DEVICE_ID_VIA_CHROME9_HD)) {
+   reg_value = BIT(4);
+   } else {
+   reg_value = BIT(0);
+   }
+
+   /* Unlock CRTC registers. */
+   svga_wcrt_mask(VGABASE, 0x11, 0x00, BIT(7));
+   svga_wcrt_mask(VGABASE, 0x47, 0x00, reg_value);
 
if (!iga->index) {
/* IGA1 reset */
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index e753e58a45ed..8002acc08fec 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -30,8 +30,6 @@
 #define _VIA_DRV_H
 
 
-#include 
-
 #include 
 
 #include 
@@ -312,18 +310,6 @@ via_lock_crtc(void __iomem *regs)
svga_wcrt_mask(regs, 0x11, BIT(7), BIT(7));
 }
 
-static inline void
-via_unlock_crtc(void __iomem *regs, int pci_id)
-{
-   u8 mask = BIT(0);
-
-   svga_wcrt_mask(regs, 0x11, 0, BIT(7));
-   if ((pci_id == PCI_DEVICE_ID_VIA_CHROME9_HCM) ||
-   (pci_id == PCI_DEVICE_ID_VIA_CHROME9_HD))
-   mask = BIT(4);
-   svga_wcrt_mask(regs, 0x47, 0, mask);
-}
-
 
 extern int via_driver_num_ioctls;
 
commit f7e25b99f3161b8dbc3e81475bfb99d0ccdbac95
Author: Kevin Brace 
Date:   Tue Jan 17 14:18:46 2023 -0600

drm/via: Rearrange mode setting code

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 2d3454f2f3b7..2b37ab23a63f 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1598,13 +1598,13 @@ void via_mode_set_nofb(struct drm_crtc *crtc)
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   if (!iga->index) {
-   /* Load standard registers */
-   via_load_vpit_regs(dev_priv);
+   /* Load standard registers */
+   via_load_vpit_regs(dev_priv);
 
-   /* Unlock */
-   via_unlock_crtc(VGABASE, pde

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - drivers/gpu/drm

2023-01-20 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.h |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 4816d27a71e065139c2a865deab76b8ce6164fc4
Author: Kevin Brace 
Date:   Tue Jan 17 14:18:40 2023 -0600

drm/via: Remove an unnecessary inclusion of drm/ttm/ttm_bo_api.h

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index ea544fb01195..e753e58a45ed 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -39,7 +39,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_memmgr.c

2023-01-17 Thread Kevin Brace
 configure.ac |2 +-
 src/via_memmgr.c |5 -
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 120a780e460e4cc51dee854b266dfcb22784746b
Author: Kevin Brace 
Date:   Tue Jan 17 18:31:02 2023 -0600

Version bumped to 0.6.603

Resolves drmCloseBufferHandle() libdrm compilation issue.  The use
of this call will be revisited eventually, but for now, it should
not be used since it was introduced only with libdrm 2.4.108 very
recently.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 6bc88ec..7c1156d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.602],
+[0.6.603],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit ee88fd8265b2fdf8fbb2aea441f6b23aeb648e45
Author: Kevin Brace 
Date:   Tue Jan 17 18:13:43 2023 -0600

Revert "Use drmCloseBufferHandle() provided by libdrm"

This reverts commit 61c14ff37dfee8e6b58733d3cc1a265a11f63e6d.

diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index 8e77756..9f507b1 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -285,9 +285,12 @@ drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *obj)
 return;
 }
 } else  if (pVia->directRenderingType == DRI_2) {
+struct drm_gem_close close;
+
 munmap(obj->ptr, obj->size);
 
-if (drmCloseBufferHandle(pVia->drmmode.fd, obj->handle)) {
+close.handle = obj->handle;
+if (drmIoctl(pVia->drmmode.fd, DRM_IOCTL_GEM_CLOSE, ) < 
0) {
 ErrorF("DRM failed to free for handle %lu.\n", 
obj->handle);
 return;
 }


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 8 commits - drivers/gpu/drm

2023-01-13 Thread Kevin Brace
 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 
Date:   Fri Jan 13 16:01:12 2023 -0600

drm/via: Include drm/drm_encoder.h where appropriate

Signed-off-by: Kevin Brace 

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 
  */
 
+#include 
+
 #include "via_drv.h"
 
 
commit a39650f8412da54df1063f6e5da7d3c06fc70765
Author: Kevin Brace 
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 

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 
  */
 
-#include 
-
 #include "via_drv.h"
 
 
commit 46190eafba649a7f52b3bec4fed7b6690827d564
Author: Kevin Brace 
Date:   Fri Jan 13 15:47:21 2023 -0600

drm/via: Remove unnecessary inclusions of linux/pci.h

Signed-off-by: Kevin Brace 

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 
  */
 
-#include 
 #include 
 
 #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 
-#include 
 
 #include 
 #include 
commit f4c4b20a74deb952c5d41637a2702e45c8995f61
Author: Kevin Brace 
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 

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 
-#include 
 
 #include "via_drv.h"
 
commit c4ddb9f9d292f732a6f2d1e322576a78d1e2214a
Author: Kevin Brace 
Date:   Fri Jan 13 14:54:34 2023 -0600

drm/via: Include drm/drm_connector.h where appropriate

Signed-off-by: Kevin Brace 

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 
  */
 
+#include 
 #include 
 
 #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 
 
 #include 
+#include 
 #include 
 #include 
 #include 
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 
 
+#include 
 #include 
 #include 
 #include 
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 
 
 #include 
+#include 
 #include 
 #include 
 #include 
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 
 
 #include 
+#include 
 #include 
 #include 
 #include 
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 
 
 #include 
+#include 
 #include 
 #include 
 #include 
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/v

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 2 commits - drivers/gpu/drm

2023-01-12 Thread Kevin Brace
 drivers/gpu/drm/via/via_dac.c|1 +
 drivers/gpu/drm/via/via_drv.h|1 -
 drivers/gpu/drm/via/via_hdmi.c   |1 +
 drivers/gpu/drm/via/via_lvds.c   |1 +
 drivers/gpu/drm/via/via_pm.c |2 ++
 drivers/gpu/drm/via/via_sii164.c |1 +
 drivers/gpu/drm/via/via_tmds.c   |1 +
 drivers/gpu/drm/via/via_vt1632.c |1 +
 8 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 63b599122a8807dda0cf33a32858acc3f15aa0fb
Author: Kevin Brace 
Date:   Thu Jan 12 16:33:51 2023 -0600

drm/via: Stop including drm/drm_crtc_helper.h from via_drv.h

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 45d30d4ee71e..bf0586acd19f 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 68b267023c39..2f3b18429b23 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -35,7 +35,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index 81a9bfa3e8e6..240fac39277b 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -30,6 +30,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index 6680970f99f7..5a02ef16bd18 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -34,6 +34,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index d919071dd349..3c70838b03a7 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 6c9c26612876..18b1e6d5aebc 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index 602dcf055f7b..db39add5ed7a 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
commit 36b76dd6fcfe863818b347ffcc03634f03fd7ca4
Author: Kevin Brace 
Date:   Thu Jan 12 16:19:26 2023 -0600

drm/via: Include drm/drm_modeset_helper.h from via_pm.c

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_pm.c b/drivers/gpu/drm/via/via_pm.c
index 5fad01447eed..43d27bc2b08a 100644
--- a/drivers/gpu/drm/via/via_pm.c
+++ b/drivers/gpu/drm/via/via_pm.c
@@ -28,6 +28,8 @@
 #include 
 #include 
 
+#include 
+
 #include "via_drv.h"
 
 


[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.3'

2023-01-12 Thread Kevin Brace
New branch 'drm-next-6.3' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.2' - 4 commits - drivers/gpu/drm

2023-01-12 Thread Kevin Brace
 drivers/gpu/drm/via/via_cursor.c |2 +-
 drivers/gpu/drm/via/via_drv.c|1 +
 drivers/gpu/drm/via/via_drv.h|5 ++---
 drivers/gpu/drm/via/via_object.c |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit dc610530eb8b82ea580f13182318004dc43efaf5
Author: Kevin Brace 
Date:   Thu Jan 12 15:44:09 2023 -0600

drm/via: Version bumped to 3.6.2

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 47435977c1a0..68b267023c39 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -49,10 +49,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  1
+#define DRIVER_PATCHLEVEL  2
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20221205"
+#define DRIVER_DATE"20230112"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit bb6afb288e4820af92f22064b2a49433f0df78c5
Author: Kevin Brace 
Date:   Thu Jan 12 14:42:38 2023 -0600

drm/via: Stop including drm/drm_fb_helper.h from via_drv.h

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index fdb508a8e1c4..e3b61e61f28c 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index b91c64183271..47435977c1a0 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -37,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
commit d0ac9b6e67518e05217deea93681a4df1f55d044
Author: Kevin Brace 
Date:   Thu Jan 12 13:00:00 2023 -0600

drm/fb-helper: Move generic fbdev emulation into separate source file

Based on commit 8ab59da (drm/fb-helper: Move generic fbdev emulation
into separate source file).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 274df166b394..fdb508a8e1c4 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -30,7 +30,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
commit fa8e394e3380d50fabbd013732ea8169519daf7d
Author: Kevin Brace 
Date:   Thu Jan 12 12:57:34 2023 -0600

drm/ttm: rework on ttm_resource to use size_t type

Based on commit e3c92eb (drm/ttm: rework on ttm_resource to use
    size_t type).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index 628c41c048e8..9a0c1fd9ff1c 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -276,7 +276,7 @@ static int via_cursor_prepare_fb(struct drm_plane *plane,
 
ret = via_bo_pin(bo, TTM_PL_VRAM);
ttm_bo_unreserve(ttm_bo);
-   ret = ttm_bo_kmap(ttm_bo, 0, ttm_bo->resource->num_pages, >kmap);
+   ret = ttm_bo_kmap(ttm_bo, 0, PFN_UP(ttm_bo->resource->size), >kmap);
if (ret) {
goto exit;
}
diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index 3d65ecb4ef1d..07837a41edd4 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -228,7 +228,7 @@ int via_bo_create(struct drm_device *dev,
goto exit;
}
 
-   ret = ttm_bo_kmap(ttm_bo, 0, ttm_bo->resource->num_pages,
+   ret = ttm_bo_kmap(ttm_bo, 0, PFN_UP(ttm_bo->resource->size),
>kmap);
if (ret) {
ttm_bo_put(ttm_bo);


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.2' - 0 commits -

2023-01-04 Thread Kevin Brace
Rebased ref, commits from common ancestor:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.3' - 0 commits -

2023-01-04 Thread Kevin Brace
Rebased ref, commits from common ancestor:


[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.3'

2022-12-27 Thread Kevin Brace
New branch 'drm-next-6.3' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.2' - drivers/gpu/drm

2022-12-27 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a3b29c12124efab6483aa2f5492e7e0af07779dd
Author: Kevin Brace 
Date:   Mon Dec 26 16:08:53 2022 -0600

drm/via: Version bumped to 3.6.2

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index b91c64183271..9c104329887d 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  1
+#define DRIVER_PATCHLEVEL  2
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20221205"
+#define DRIVER_DATE"20221226"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 


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

2022-12-27 Thread Kevin Brace
 drivers/gpu/drm/via/via_cursor.c |2 +-
 drivers/gpu/drm/via/via_drv.c|2 +-
 drivers/gpu/drm/via/via_init.c   |2 --
 drivers/gpu/drm/via/via_object.c |2 +-
 4 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit ff418592d4d3a5f236b00cd1ea525eeca61a785c
Author: Kevin Brace 
Date:   Mon Dec 26 13:45:05 2022 -0600

drm/fb-helper: Move generic fbdev emulation into separate source file

Based on commit 8ab59da (drm/fb-helper: Move generic fbdev emulation
into separate source file).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 274df166b394..fdb508a8e1c4 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -30,7 +30,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
commit 5baa67c9fdf5b325e7cc03e83bfc981ff0949e80
Author: Kevin Brace 
Date:   Mon Dec 26 13:45:04 2022 -0600

drm/ttm: rework on ttm_resource to use size_t type

Based on commit e3c92eb (drm/ttm: rework on ttm_resource to use
size_t type).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_cursor.c b/drivers/gpu/drm/via/via_cursor.c
index 628c41c048e8..e800aff1178b 100644
--- a/drivers/gpu/drm/via/via_cursor.c
+++ b/drivers/gpu/drm/via/via_cursor.c
@@ -276,7 +276,7 @@ static int via_cursor_prepare_fb(struct drm_plane *plane,
 
ret = via_bo_pin(bo, TTM_PL_VRAM);
ttm_bo_unreserve(ttm_bo);
-   ret = ttm_bo_kmap(ttm_bo, 0, ttm_bo->resource->num_pages, >kmap);
+   ret = ttm_bo_kmap(ttm_bo, 0, ttm_bo->resource->size, >kmap);
if (ret) {
goto exit;
}
diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index 3d65ecb4ef1d..eff187af86e3 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -228,7 +228,7 @@ int via_bo_create(struct drm_device *dev,
goto exit;
}
 
-   ret = ttm_bo_kmap(ttm_bo, 0, ttm_bo->resource->num_pages,
+   ret = ttm_bo_kmap(ttm_bo, 0, ttm_bo->resource->size,
>kmap);
if (ret) {
ttm_bo_put(ttm_bo);
commit b7d0856da4c2db186cc1ddf28ea8747328ca2465
Author: Kevin Brace 
Date:   Mon Dec 26 13:45:03 2022 -0600

drm: Remove drm_mode_config::fb_base

Based on commit 7c99616 (drm: Remove drm_mode_config::fb_base).
    
Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index f3cf17a3b1b8..701c02be4737 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1234,8 +1234,6 @@ void via_mode_config_init(struct via_drm_priv *dev_priv)
 
dev->mode_config.funcs = _drm_mode_config_funcs;
 
-   dev->mode_config.fb_base = dev_priv->vram_start;
-
dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow_fbdev = true;
 


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.2' - 43 commits - drivers/gpu/drm

2022-12-27 Thread Kevin Brace
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |   17 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c   |  251 
++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |   10 
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c|   13 
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c |6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c|   16 
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c|   12 
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.h|3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c|   88 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h|3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.h|2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |   40 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c|   24 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h|6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c   |1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c |   79 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h |6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c|2 
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  |4 
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c |3 
 drivers/gpu/drm/amd/amdgpu/soc21.c |1 
 drivers/gpu/drm/amd/amdkfd/kfd_process.c   |   24 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |1 
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |2 
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c|4 
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h   |2 
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h |2 
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h   |3 
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h   |4 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |   17 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c   |  113 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c   |   42 +
 drivers/gpu/drm/i915/display/g4x_dp.c  |4 
 drivers/gpu/drm/i915/display/g4x_hdmi.c|   25 
 drivers/gpu/drm/i915/display/intel_dp.c|   59 --
 drivers/gpu/drm/i915/gem/i915_gem_object.c |3 
 drivers/gpu/drm/i915/gem/i915_gem_object_types.h   |   10 
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c |   18 
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c |2 
 drivers/gpu/drm/i915/gt/intel_migrate.c|   53 +-
 drivers/gpu/drm/i915/i915_perf.c   |6 
 drivers/gpu/drm/i915/intel_uncore.c|4 
 47 files changed, 647 insertions(+), 372 deletions(-)

New commits:
commit 4f57d6b64156f439a8fd4ed1d35f8cdd9f789874
Merge: a6f2f56ccb44 fe8f5b2f7bec
Author: Kevin Brace 
Date:   Mon Dec 26 13:36:32 2022 -0600

Merge tag 'drm-next-2022-12-23' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.2

drm fixes for 6.2-rc1

amdgpu:
- Spelling fix
- BO pin fix
- Properly handle polaris 10/11 overlap asics
- GMC9 fix
- SR-IOV suspend fix
- DCN 3.1.4 fix
- KFD userptr locking fix
- SMU13.x fixes
- GDS/GWS/OA handling fix
- Reserved VMID handling fixes
- FRU EEPROM fix
- BO validation fixes
- Avoid large variable on the stack
- S0ix fixes
- SMU 13.x fixes
- VCN fix
- Add missing fence reference

amdkfd:
- Fix init vm error handling
- Fix double release of compute pasid

i915
- Documentation fixes
- OA-perf related fix
- VLV/CHV HDMI/DP audio fix
- Display DDI/Transcoder fix
- Migrate fixes

commit fe8f5b2f7bec504021b395d24f7efca415d21e2b
Merge: 38624d2c972e c1c4a8b21721
Author: Dave Airlie 
Date:   Thu Dec 22 11:02:55 2022 +1000

Merge tag 'amd-drm-fixes-6.2-2022-12-21' of 
https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-fixes-6.2-2022-12-21:

amdgpu:
- Avoid large variable on the stack
- S0ix fixes

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.2' - 0 commits -

2022-12-26 Thread Kevin Brace
Rebased ref, commits from common ancestor:


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.2' - 43 commits - drivers/gpu/drm

2022-12-24 Thread Kevin Brace
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |   17 
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c   |  251 
++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |   10 
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c|   13 
 drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c |6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c|   16 
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c|   12 
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.h|3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c|   88 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h|3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.h|2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |   40 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |2 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c|   24 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h|6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c   |1 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c |   79 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h |6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c|2 
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  |4 
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c |3 
 drivers/gpu/drm/amd/amdgpu/soc21.c |1 
 drivers/gpu/drm/amd/amdkfd/kfd_process.c   |   24 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |1 
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |2 
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c|4 
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.c|8 
 drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h   |2 
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h |2 
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h   |3 
 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h   |4 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |   17 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c   |  113 
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c   |   42 +
 drivers/gpu/drm/i915/display/g4x_dp.c  |4 
 drivers/gpu/drm/i915/display/g4x_hdmi.c|   25 
 drivers/gpu/drm/i915/display/intel_dp.c|   59 --
 drivers/gpu/drm/i915/gem/i915_gem_object.c |3 
 drivers/gpu/drm/i915/gem/i915_gem_object_types.h   |   10 
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c |   18 
 drivers/gpu/drm/i915/gt/intel_gt_mcr.c |2 
 drivers/gpu/drm/i915/gt/intel_migrate.c|   53 +-
 drivers/gpu/drm/i915/i915_perf.c   |6 
 drivers/gpu/drm/i915/intel_uncore.c|4 
 47 files changed, 647 insertions(+), 372 deletions(-)

New commits:
commit 991f428b267e86129f40ccac7ff0f81bf622cfb1
Merge: a6f2f56ccb44 fe8f5b2f7bec
Author: Kevin Brace 
Date:   Sat Dec 24 20:40:12 2022 -0600

Merge tag 'drm-next-2022-12-23' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.2

drm fixes for 6.2-rc1

amdgpu:
- Spelling fix
- BO pin fix
- Properly handle polaris 10/11 overlap asics
- GMC9 fix
- SR-IOV suspend fix
- DCN 3.1.4 fix
- KFD userptr locking fix
- SMU13.x fixes
- GDS/GWS/OA handling fix
- Reserved VMID handling fixes
- FRU EEPROM fix
- BO validation fixes
- Avoid large variable on the stack
- S0ix fixes
- SMU 13.x fixes
- VCN fix
- Add missing fence reference

amdkfd:
- Fix init vm error handling
- Fix double release of compute pasid

i915
- Documentation fixes
- OA-perf related fix
- VLV/CHV HDMI/DP audio fix
- Display DDI/Transcoder fix
- Migrate fixes

commit fe8f5b2f7bec504021b395d24f7efca415d21e2b
Merge: 38624d2c972e c1c4a8b21721
Author: Dave Airlie 
Date:   Thu Dec 22 11:02:55 2022 +1000

Merge tag 'amd-drm-fixes-6.2-2022-12-21' of 
https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-fixes-6.2-2022-12-21:

amdgpu:
- Avoid large variable on the stack
- S0ix fixes

[openchrome-devel] drm-openchrome: Branch 'drm-next-6.1' - 2 commits - drivers/gpu/drm

2022-12-23 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.h  |5 ++---
 drivers/gpu/drm/via/via_init.c |4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit a2038a3f01c6b778d1caf3bf53b6595a840a0a73
Author: Kevin Brace 
Date:   Mon Dec 5 09:54:11 2022 -0600

drm/via: Version bumped to 3.6.1

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 1b837464085b..b91c64183271 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   6
-#define DRIVER_PATCHLEVEL  0
+#define DRIVER_PATCHLEVEL  1
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20220908"
+#define DRIVER_DATE"20221205"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 2cb71effe40116314cf1e37d3be106807ad77a2a
Author: Kevin Brace 
Date:   Mon Dec 5 09:11:49 2022 -0600

drm/via: Add via_ to chip_revision_info()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 282231c467ac..1b837464085b 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -337,7 +337,6 @@ void via_vram_fini(struct via_drm_priv *dev_priv);
 int via_mmio_init(struct via_drm_priv *dev_priv);
 void via_mmio_fini(struct via_drm_priv *dev_priv);
 void via_graphics_unlock(struct via_drm_priv *dev_priv);
-void chip_revision_info(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);
diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index 0e478b974628..f3cf17a3b1b8 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -1116,7 +1116,7 @@ void via_graphics_unlock(struct via_drm_priv *dev_priv)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-void chip_revision_info(struct via_drm_priv *dev_priv)
+static void via_chip_revision_info(struct via_drm_priv *dev_priv)
 {
struct drm_device *dev = _priv->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
@@ -1266,7 +1266,7 @@ int via_drm_init(struct drm_device *dev)
goto exit;
}
 
-   chip_revision_info(dev_priv);
+   via_chip_revision_info(dev_priv);
 
ret = via_modeset_init(dev);
if (ret) {


[openchrome-devel] drm-openchrome: Branch 'drm-next-6.1' - 2 commits - drivers/gpu/drm

2022-10-10 Thread Kevin Brace
 drivers/gpu/drm/scheduler/sched_main.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit be32b28967f485382fa663556811bc2ed7c4e539
Merge: 3dd924190fe9 bafaf67c42f4
Author: Kevin Brace 
Date:   Mon Oct 10 18:38:22 2022 -0500

Merge tag 'drm-next-2022-10-07-1' of git://anongit.freedesktop.org/drm/drm 
into drm-next-6.1

drm fix for 6.1-rc1

sched:
- revert patch causing oopses

commit bafaf67c42f4b547bf4fb329ac6dcb28b05de15e
Author: Dave Airlie 
Date:   Fri Oct 7 12:40:50 2022 +1000

Revert "drm/sched: Use parent fence instead of finished"

This reverts commit e4dc45b1848bc6bcac31eb1b4ccdd7f6718b3c86.

This is causing instability on Linus' desktop, and I'm seeing
oops with VK CTS runs.

netconsole got me the following oops:
[ 1234.778760] BUG: kernel NULL pointer dereference, address: 
0088
[ 1234.778782] #PF: supervisor read access in kernel mode
[ 1234.778787] #PF: error_code(0x) - not-present page
[ 1234.778791] PGD 0 P4D 0
[ 1234.778798] Oops:  [#1] PREEMPT SMP NOPTI
[ 1234.778803] CPU: 7 PID: 805 Comm: systemd-journal Not tainted 6.0.0+ #2
[ 1234.778809] Hardware name: System manufacturer System Product
Name/PRIME X370-PRO, BIOS 5603 07/28/2020
[ 1234.778813] RIP: 0010:drm_sched_job_done.isra.0+0xc/0x140 [gpu_sched]
[ 1234.778828] Code: aa 0f 1d ce e9 57 ff ff ff 48 89 d7 e8 9d 8f 3f
ce e9 4a ff ff ff 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 55 53
48 89 fb <48> 8b af 88 00 00 00 f0 ff 8d f0 00 00 00 48 8b 85 80 01 00
00 f0
[ 1234.778834] RSP: :abe680380de0 EFLAGS: 00010087
[ 1234.778839] RAX: c04e9230 RBX:  RCX: 
0018
[ 1234.778897] RDX: 0ba278e8977a RSI: 953fb288b460 RDI: 

[ 1234.778901] RBP: 953fb288b598 R08: 00e0 R09: 
953fbd98b808
[ 1234.778905] R10:  R11: abe680380ff8 R12: 
abe680380e00
[ 1234.778908] R13: 0001 R14:  R15: 
953fbd9ec458
[ 1234.778912] FS:  7f35e7008580() GS:95428ebc()
knlGS:
[ 1234.778916] CS:  0010 DS:  ES:  CR0: 80050033
[ 1234.778919] CR2: 0088 CR3: 00010147c000 CR4: 
003506e0
[ 1234.778924] Call Trace:
[ 1234.778981]  
[ 1234.778989]  dma_fence_signal_timestamp_locked+0x6a/0xe0
[ 1234.778999]  dma_fence_signal+0x2c/0x50
[ 1234.779005]  amdgpu_fence_process+0xc8/0x140 [amdgpu]
[ 1234.779234]  sdma_v3_0_process_trap_irq+0x70/0x80 [amdgpu]
[ 1234.779395]  amdgpu_irq_dispatch+0xa9/0x1d0 [amdgpu]
[ 1234.779609]  amdgpu_ih_process+0x80/0x100 [amdgpu]
[ 1234.779783]  amdgpu_irq_handler+0x1f/0x60 [amdgpu]
[ 1234.779940]  __handle_irq_event_percpu+0x46/0x190
[ 1234.779946]  handle_irq_event+0x34/0x70
[ 1234.779949]  handle_edge_irq+0x9f/0x240
[ 1234.779954]  __common_interrupt+0x66/0x100
[ 1234.779960]  common_interrupt+0xa0/0xc0
[ 1234.779965]  
[ 1234.779968]  
[ 1234.779971]  asm_common_interrupt+0x22/0x40
[ 1234.779976] RIP: 0010:finish_mkwrite_fault+0x22/0x110
[ 1234.779981] Code: 1f 84 00 00 00 00 00 90 0f 1f 44 00 00 41 55 41
54 55 48 89 fd 53 48 8b 07 f6 40 50 08 0f 84 eb 00 00 00 48 8b 45 30
48 8b 18 <48> 89 df e8 66 bd ff ff 48 85 c0 74 0d 48 89 c2 83 e2 01 48
83 ea
[ 1234.779985] RSP: :abe680bcfd78 EFLAGS: 0202

Revert it for now and figure it out later.

Signed-off-by: Dave Airlie 

diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
b/drivers/gpu/drm/scheduler/sched_main.c
index 4f2395d1a791..e5a4ecde0063 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -829,7 +829,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
job = list_first_entry_or_null(>pending_list,
   struct drm_sched_job, list);
 
-   if (job && dma_fence_is_signaled(job->s_fence->parent)) {
+   if (job && dma_fence_is_signaled(>s_fence->finished)) {
/* remove job from pending_list */
list_del_init(>list);
 
@@ -841,7 +841,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
 
if (next) {
next->s_fence->scheduled.timestamp =
-   job->s_fence->parent->timestamp;
+   job->s_fence->finished.timestamp;
/* start TO timer for next job */
drm_sched_start_timeout(sched);
}


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 15 commits - configure.ac src/drmmode_display.c src/via_dri.c src/via_driver.c src/via_driver.h src/via_exa.c src/via_exa_h2.c src/via_exa_h6.

2022-09-20 Thread Kevin Brace
 configure.ac  |2 +-
 src/drmmode_display.c |1 -
 src/via_dri.c |5 ++---
 src/via_driver.c  |5 +
 src/via_driver.h  |9 -
 src/via_exa.c |6 +-
 src/via_exa_h2.c  |3 ---
 src/via_exa_h6.c  |3 ---
 src/via_memmgr.c  |4 +++-
 src/via_xv.c  |4 
 src/via_xv_overlay.c  |1 -
 src/via_xvmc.c|5 +
 12 files changed, 13 insertions(+), 35 deletions(-)

New commits:
commit 4e0a2273eb2bd4a5e1932a1d2245626a24a45f5d
Author: Kevin Brace 
Date:   Fri Sep 16 18:30:45 2022 -0700

Version bumped to 0.6.601

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index e065a51..b3678d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.600],
+[0.6.601],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit 80022ba7db4c1b568e24c82abf5e857ffc08ed46
Author: Kevin Brace 
Date:   Fri Sep 16 18:28:10 2022 -0700

Stop including xf86Cursor.h

Signed-off-by: Kevin Brace 

diff --git a/src/via_driver.h b/src/via_driver.h
index a6b4a62..15ea3a8 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -41,7 +41,6 @@
 
 #include "xf86.h"
 #include "xf86Crtc.h"
-#include "xf86Cursor.h"
 #include "xf86fbman.h"
 #include "xf86RandR12.h"
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
commit cf86b0bf7eeecd265fa97da89b181fdf70790e3a
Author: Kevin Brace 
Date:   Fri Sep 16 18:28:10 2022 -0700

    Stop including regionstr.h

Signed-off-by: Kevin Brace 

diff --git a/src/via_xv.c b/src/via_xv.c
index 247c91e..739dfe8 100644
--- a/src/via_xv.c
+++ b/src/via_xv.c
@@ -37,7 +37,6 @@
 #endif
 
 #include "compiler.h"
-#include "regionstr.h"
 #include "via_driver.h"
 
 #include "xf86xv.h"
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index c4f5763..0814efa 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -32,7 +32,6 @@
 #endif
 
 #include "compiler.h"
-#include "regionstr.h"
 
 #ifdef OPENCHROMEDRI
 
commit 91bbb39150b11c6ac088610a29d790a9691fc4b6
Author: Kevin Brace 
Date:   Fri Sep 16 18:28:10 2022 -0700

Stop including sarea.h from src/via_driver.h

Signed-off-by: Kevin Brace 

diff --git a/src/via_driver.h b/src/via_driver.h
index a1b3e46..a6b4a62 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -71,7 +71,6 @@
 #define _XF86DRI_SERVER_
 #include "xf86dri.h"
 
-#include "sarea.h"
 #include "dri.h"
 #include "drm_fourcc.h"
 #include "GL/glxint.h"
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index a9978c9..c4f5763 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include "via_xvmc.h"
+#include "sarea.h"
 #include "dristruct.h"
 #include "dri.h"
 #include "via_xvpriv.h"
commit 98e378679a21322ab7030af013eacde5cb63f84a
Author: Kevin Brace 
Date:   Fri Sep 16 18:28:09 2022 -0700

Reduce unnecessary inclusion of sys/mman.h

Signed-off-by: Kevin Brace 

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 5caaddd..6f635a1 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -31,7 +31,6 @@
 
 #include 
 #include 
-#include 
 #include "xf86str.h"
 #include "X11/Xatom.h"
 #include "micmap.h"
diff --git a/src/via_exa.c b/src/via_exa.c
index 12d4fa0..55a7daf 100644
--- a/src/via_exa.c
+++ b/src/via_exa.c
@@ -35,8 +35,6 @@
 
 #include 
 
-#include 
-
 #include "via_driver.h"
 #include "via_regs.h"
 #include "via_dmabuffer.h"
commit bc329e9650bf00e1ae62551377c796ddc8d35be8
Author: Kevin Brace 
Date:   Fri Sep 16 18:28:09 2022 -0700

Stop including dixstruct.h

Signed-off-by: Kevin Brace 

diff --git a/src/via_xv.c b/src/via_xv.c
index a97e976..247c91e 100644
--- a/src/via_xv.c
+++ b/src/via_xv.c
@@ -42,7 +42,6 @@
 
 #include "xf86xv.h"
 #include 
-#include "dixstruct.h"
 #include "via_xvpriv.h"
 #include "fourcc.h"
 
diff --git a/src/via_xvmc.c b/src/via_xvmc.c
index d3705d6..a9978c9 100644
--- a/src/via_xvmc.c
+++ b/src/via_xvmc.c
@@ -51,7 +51,6 @@
 #include "xf86xvmc.h"
 #include 
 #include 
-#include "dixstruct.h"
 #include "via_xvmc.h"
 #include "dristruct.h"
 #include "dri.h"
commit 2a82b5718315b6a27133a416b7584f133e521157
Author: Kevin Brace 
Date:   Fri Sep 16 18:28:09 2022 -0700

Stop including xf86_OSproc.h

Signed-off-by: Kevin Brace 

diff --git a/src/via_dri.c b/src/via_dri.c
index db2ea0e..2921aab 100644
--- a/src/via_dri.c
+++ b/src/via_dri.c
@@ -31,7 +31,6 @@
 #include 
 
 #include "xf86.h"
-#include "xf86_

[openchrome-devel] drm-openchrome: Changes to 'drm-next-6.1'

2022-09-08 Thread Kevin Brace
New branch 'drm-next-6.1' available with the following commits:


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 11 commits - configure.ac src/drmmode_display.c src/via_display.c src/via_dri.c src/via_driver.c src/via_drm.h src/via_exa.c src/via_memcpy.c

2022-09-08 Thread Kevin Brace
 configure.ac  |2 -
 src/drmmode_display.c |1 
 src/via_display.c |1 
 src/via_dri.c |3 --
 src/via_driver.c  |5 ---
 src/via_drm.h |   66 +++---
 src/via_exa.c |2 -
 src/via_memcpy.c  |1 
 src/via_memmgr.c  |   65 -
 src/via_memmgr.h  |1 
 src/via_ums.c |4 ---
 src/via_xv_overlay.c  |4 ---
 src/via_xvmc.c|1 
 13 files changed, 67 insertions(+), 89 deletions(-)

New commits:
commit 3194fb08b38176111babaebf7fb3e02b2a5edb03
Author: Kevin Brace 
Date:   Thu Sep 8 16:45:31 2022 -0700

Version bumped to 0.6.600

OpenChrome DRM Version 3.6.0 or later is required for KMS.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 7af9956..e065a51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.501],
+[0.6.600],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit c36a6c45dc4bbdbcdae76e66c658ab334ea04c8c
Author: Kevin Brace 
Date:   Thu Sep 8 16:45:31 2022 -0700

Require OpenChrome DRM Version 3.6.0 or later for KMS

Made many updates to OpenChrome DRM uAPI, so the DDX requires a newer
OpenChrome DRM version.

Signed-off-by: Kevin Brace 

diff --git a/src/via_driver.c b/src/via_driver.c
index c4a97bf..0b2bb6a 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -65,7 +65,7 @@
 #ifdef OPENCHROMEDRI
 static const ViaDRMVersion drmVIADRMExpected = { 1, 3, 0 };
 static const ViaDRMVersion drmVIADRMCompat = { 3, 0, 0 };
-static const ViaDRMVersion drmVIADRMKMSSupport = { 3, 5, 0 };
+static const ViaDRMVersion drmVIADRMKMSSupport = { 3, 6, 0 };
 #endif /* OPENCHROMEDRI */
 
 /* Prototypes. */
commit 18e1be5b42fc568c55e901d073e158b06423befa
Author: Kevin Brace 
Date:   Thu Sep 8 16:45:31 2022 -0700

Update uAPI header copyright year

Signed-off-by: Kevin Brace 

diff --git a/src/via_drm.h b/src/via_drm.h
index 129dfcd..e36c165 100644
--- a/src/via_drm.h
+++ b/src/via_drm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 Kevin Brace
+ * Copyright © 2020-2022 Kevin Brace
  * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
  * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
  *
commit b3a8058649ed06520c566341ac02faf71f326a56
Author: Kevin Brace 
Date:   Thu Sep 8 16:45:30 2022 -0700

Add comments to uAPI IOCTL structs

Suggested-by: Sam Ravnborg 
Signed-off-by: Kevin Brace 

diff --git a/src/via_drm.h b/src/via_drm.h
index a880b15..129dfcd 100644
--- a/src/via_drm.h
+++ b/src/via_drm.h
@@ -292,18 +292,41 @@ typedef struct drm_via_dmablit {
 /*
  * OpenChrome DRM IOCTL structs
  */
+
+/**
+ * struct drm_via_gem_alloc - IOCTL argument for allocating a GEM based BO
+ * (Buffer Object).
+ */
 struct drm_via_gem_alloc {
+   /* Alignment of the BO. */
__u32 alignment;
__u32 pad;
+
+   /* Size of the BO. Note that the actual size gets returned from DRM.*/
__u64 size;
+
+   /*
+* TTM domain of the BO. Note that the actual domain gets returned
+* from DRM.
+*/
__u32 domain;
+
+   /* GEM handle to the BO returned from DRM. */
__u32 handle;
+
+   /* Offset returned from DRM. */
__u64 offset;
 };
 
+/**
+ * struct drm_via_gem_mmap - IOCTL argument for mapping a GEM based BO.
+ */
 struct drm_via_gem_mmap {
+   /* GEM handle of the BO. */
__u32 handle;
__u32 pad;
+
+   /* Offset returned from DRM. */
__u64 offset;
 };
 
commit e3405cb7a042886cddaede74af31bb15fef195ea
Author: Kevin Brace 
Date:   Thu Sep 8 16:45:30 2022 -0700

Pad uAPI IOCTL structs to a 64-bit boundary

Suggested-by: Daniel Vetter 
Signed-off-by: Kevin Brace 
Link: https://blog.ffwll.ch/2013/11/botching-up-ioctls.html

diff --git a/src/via_drm.h b/src/via_drm.h
index f2560cb..a880b15 100644
--- a/src/via_drm.h
+++ b/src/via_drm.h
@@ -294,6 +294,7 @@ typedef struct drm_via_dmablit {
  */
 struct drm_via_gem_alloc {
__u32 alignment;
+   __u32 pad;
__u64 size;
__u32 domain;
__u32 handle;
@@ -302,6 +303,7 @@ struct drm_via_gem_alloc {
 
 struct drm_via_gem_mmap {
__u32 handle;
+   __u32 pad;
__u64 offset;
 };
 
commit c04190da30a487a074d0a072a362826cd0a258fe
Author: Kevin Brace 
Date:   Thu Sep 8 16:45:30 2022 -0700

Convert from uint*_t to __u*

Examples include conversion to __u32 and __u64 types.

Suggested-by: Daniel Vetter 
Signed-off-by: Kevin Brace 
Link: https://blog.ffwll.ch/2013/11/botching-up-ioctls.html

diff --git a/src/via_drm.h b/src/via_drm.h
index 1cceba5..f2560cb 100644
--- a/src/via_drm.h
+++ b/src/via_drm.h
@@ -293,16 +293,16

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 9 commits - drivers/gpu/drm include/uapi/drm

2022-09-08 Thread Kevin Brace
 drivers/gpu/drm/Makefile|2 -
 drivers/gpu/drm/via/Kconfig |2 -
 drivers/gpu/drm/via/Makefile|2 -
 drivers/gpu/drm/via/via_drv.c   |5 +--
 drivers/gpu/drm/via/via_drv.h   |   12 +++
 drivers/gpu/drm/via/via_ioctl.c |   25 +++
 include/uapi/drm/via_drm.h  |   66 
 7 files changed, 62 insertions(+), 52 deletions(-)

New commits:
commit ded8ec0d2643f48fe857df54a64d22e4aef8ab95
Author: Kevin Brace 
Date:   Thu Sep 8 16:37:54 2022 -0700

drm/via: Version bumped to 3.6.0

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 4d8ca542575b..282231c467ac 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -49,11 +49,11 @@
 
 
 #define DRIVER_MAJOR   3
-#define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  8
+#define DRIVER_MINOR   6
+#define DRIVER_PATCHLEVEL  0
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20220728"
+#define DRIVER_DATE"20220908"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit fb3aaee89bf148aefdd72d6c9d7080ea647e6125
Author: Kevin Brace 
Date:   Thu Sep 8 16:37:52 2022 -0700

drm/via: Change the makefile configuration name back to VIA

    Suggested-by: Sam Ravnborg 
Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 7f76270c2b47..cda36292decd 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -98,7 +98,7 @@ obj-$(CONFIG_DRM_VC4)  += vc4/
 obj-$(CONFIG_DRM_SIS)   += sis/
 obj-$(CONFIG_DRM_SAVAGE)+= savage/
 obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
-obj-$(CONFIG_DRM_OPENCHROME) +=via/
+obj-$(CONFIG_DRM_VIA)  += via/
 obj-$(CONFIG_DRM_VGEM) += vgem/
 obj-$(CONFIG_DRM_VKMS) += vkms/
 obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
diff --git a/drivers/gpu/drm/via/Kconfig b/drivers/gpu/drm/via/Kconfig
index 7c4656a1d473..fa6ade047a37 100644
--- a/drivers/gpu/drm/via/Kconfig
+++ b/drivers/gpu/drm/via/Kconfig
@@ -1,4 +1,4 @@
-config DRM_OPENCHROME
+config DRM_VIA
tristate "OpenChrome (VIA Technologies Chrome)"
depends on DRM && PCI && X86
select DRM_KMS_HELPER
diff --git a/drivers/gpu/drm/via/Makefile b/drivers/gpu/drm/via/Makefile
index 73ccacb4cd11..096128c9d910 100644
--- a/drivers/gpu/drm/via/Makefile
+++ b/drivers/gpu/drm/via/Makefile
@@ -23,4 +23,4 @@ via-y := via_crtc.o \
via_ttm.o \
via_vt1632.o
 
-obj-$(CONFIG_DRM_OPENCHROME)   += via.o
+obj-$(CONFIG_DRM_VIA)  += via.o
commit 45213acf1ec9c362f487214da61feb5f8f7a2158
Author: Kevin Brace 
Date:   Thu Sep 8 16:37:50 2022 -0700

    drm/via: Update uAPI header copyright

Signed-off-by: Kevin Brace 

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 129dfcd28feb..e36c1656f237 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 Kevin Brace
+ * Copyright © 2020-2022 Kevin Brace
  * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
  * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
  *
commit 0a4a5dc1458979fab92a08535b64e96d5bffaf0f
Author: Kevin Brace 
Date:   Thu Sep 8 16:37:47 2022 -0700

drm/via: Add comments to uAPI IOCTL structs

Suggested-by: Sam Ravnborg 
Signed-off-by: Kevin Brace 

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index a880b154ee74..129dfcd28feb 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -292,18 +292,41 @@ typedef struct drm_via_dmablit {
 /*
  * OpenChrome DRM IOCTL structs
  */
+
+/**
+ * struct drm_via_gem_alloc - IOCTL argument for allocating a GEM based BO
+ * (Buffer Object).
+ */
 struct drm_via_gem_alloc {
+   /* Alignment of the BO. */
__u32 alignment;
__u32 pad;
+
+   /* Size of the BO. Note that the actual size gets returned from DRM.*/
__u64 size;
+
+   /*
+* TTM domain of the BO. Note that the actual domain gets returned
+* from DRM.
+*/
__u32 domain;
+
+   /* GEM handle to the BO returned from DRM. */
__u32 handle;
+
+   /* Offset returned from DRM. */
__u64 offset;
 };
 
+/**
+ * struct drm_via_gem_mmap - IOCTL argument for mapping a GEM based BO.
+ */
 struct drm_via_gem_mmap {
+   /* GEM handle of the BO. */
__u32 handle;
__u32 pad;
+
+   /* Offset returned from DRM. */
__u64 offset;
 };
 
commit 38d791fb0c4a9cf0f1f668f6e1a11a5ad71db21e
Author: Kevin Brace 
Date:   Thu Sep 8 16:37:45 2022 -0700

drm/via: Pad uAPI IOCTL structs to a 64-bit boundary

Suggested-by: Daniel Vetter 
Signed-off-by: Kevin Brace 
Link: https://blog.ffwll.ch/2013/11/bot

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 2 commits - drivers/gpu/drm

2022-08-16 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c   |1 +
 drivers/gpu/drm/via/via_dac.c|1 +
 drivers/gpu/drm/via/via_hdmi.c   |1 +
 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 +
 7 files changed, 7 insertions(+)

New commits:
commit b82a3f9a7152521d9b88ae073716d2d2489bee6c
Author: Kevin Brace 
Date:   Mon Aug 15 18:22:50 2022 -0700

drm: Drop drm_framebuffer.h from drm_crtc.h

Based on commit 720cf96 (drm: Drop drm_framebuffer.h from drm_crtc.h).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index d00f56d8c974..d0addd277b2f 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
commit ea30ddfb209c77343b29c7ff59b97462d90a5896
Author: Kevin Brace 
Date:   Mon Aug 15 18:08:01 2022 -0700

drm: Drop drm_edid.h from drm_crtc.h

Based on commit 255490f (drm: Drop drm_edid.h from drm_crtc.h).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_dac.c b/drivers/gpu/drm/via/via_dac.c
index 0e133c6f6551..45d30d4ee71e 100644
--- a/drivers/gpu/drm/via/via_dac.c
+++ b/drivers/gpu/drm/via/via_dac.c
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include "via_crtc_hw.h"
diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index 566d4536ebd4..81a9bfa3e8e6 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -30,6 +30,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index 5a582807a138..6680970f99f7 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -34,6 +34,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include "via_drv.h"
diff --git a/drivers/gpu/drm/via/via_sii164.c b/drivers/gpu/drm/via/via_sii164.c
index 05a4c0230fd7..d919071dd349 100644
--- a/drivers/gpu/drm/via/via_sii164.c
+++ b/drivers/gpu/drm/via/via_sii164.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include "via_drv.h"
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 71dad264a46b..6c9c26612876 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include "via_drv.h"
diff --git a/drivers/gpu/drm/via/via_vt1632.c b/drivers/gpu/drm/via/via_vt1632.c
index 30e004e421c0..602dcf055f7b 100644
--- a/drivers/gpu/drm/via/via_vt1632.c
+++ b/drivers/gpu/drm/via/via_vt1632.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include "via_drv.h"


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 4 commits - drivers/gpu/drm

2022-08-12 Thread Kevin Brace
 drivers/gpu/drm/drm_gem.c  |4 ++--
 drivers/gpu/drm/drm_gem_shmem_helper.c |1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a3cf1e79943c6736107ef9358c5685f97df80185
Merge: 0dbc64716977 36fa1cb56ac5
Author: Kevin Brace 
Date:   Fri Aug 12 16:49:38 2022 -0700

Merge tag 'drm-next-2022-08-12-1' of git://anongit.freedesktop.org/drm/drm 
into drm-next-5.20

drm fixes for 6.0-rc1

gem:
- Annotate WW context in error paths

shmem-helper:
- Add missing vunmap in error paths

commit 36fa1cb56ac5189c78dacbbb14d452d0c44b86c0
Merge: 5493ee1919ea 2939deac1fa2
Author: Dave Airlie 
Date:   Fri Aug 12 05:57:05 2022 +1000

Merge tag 'drm-misc-next-fixes-2022-08-10' of 
git://anongit.freedesktop.org/drm/drm-misc into drm-next

Short summary of fixes pull:

 * gem: Annotate WW context in error paths
 * shmem-helper: Add missing vunmap in error paths

Signed-off-by: Dave Airlie 

From: Thomas Zimmermann 
Link: 
https://patchwork.freedesktop.org/patch/msgid/YvOLPpufsvOJHiNY@linux-uq9g

commit 2939deac1fa220bc82b89235f146df1d9b52e876
Author: Dmitry Osipenko 
Date:   Thu Jun 30 23:04:04 2022 +0300

drm/gem: Properly annotate WW context on drm_gem_lock_reservations() error

Use ww_acquire_fini() in the error code paths. Otherwise lockdep
thinks that lock is held when lock's memory is freed after the
drm_gem_lock_reservations() error. The ww_acquire_context needs to be
annotated as "released", which fixes the noisy "WARNING: held lock freed!"
splat of VirtIO-GPU driver with CONFIG_DEBUG_MUTEXES=y and enabled lockdep.

Cc: sta...@vger.kernel.org
Fixes: 7edc3e3b975b5 ("drm: Add helpers for locking an array of BO 
reservations.")
Reviewed-by: Thomas Hellström 
Reviewed-by: Christian König 
Signed-off-by: Dmitry Osipenko 
Signed-off-by: Daniel Vetter 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20220630200405.1883897-2-dmitry.osipe...@collabora.com

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index eb0c2d041f13..86d670c71286 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -1226,7 +1226,7 @@ retry:
ret = dma_resv_lock_slow_interruptible(obj->resv,
 acquire_ctx);
if (ret) {
-   ww_acquire_done(acquire_ctx);
+   ww_acquire_fini(acquire_ctx);
return ret;
}
}
@@ -1251,7 +1251,7 @@ retry:
goto retry;
}
 
-   ww_acquire_done(acquire_ctx);
+   ww_acquire_fini(acquire_ctx);
return ret;
}
}
commit df4aaf015775221dde8a51ee09edb919981f091e
Author: Dmitry Osipenko 
Date:   Thu Jun 30 23:00:57 2022 +0300

drm/shmem-helper: Add missing vunmap on error

The vmapping of dma-buf may succeed, but DRM SHMEM rejects the IOMEM
mapping, and thus, drm_gem_shmem_vmap_locked() should unvmap the IOMEM
before erroring out.

Cc: sta...@vger.kernel.org
Fixes: 49a3f51dfeee ("drm/gem: Use struct dma_buf_map in GEM vmap ops and 
convert GEM backends")
Signed-off-by: Dmitry Osipenko 
Signed-off-by: Daniel Vetter 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20220630200058.1883506-2-dmitry.osipe...@collabora.com

diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c 
b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 8ad0e02991ca..904fc893c905 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -302,6 +302,7 @@ static int drm_gem_shmem_vmap_locked(struct 
drm_gem_shmem_object *shmem,
ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
if (!ret) {
if (WARN_ON(map->is_iomem)) {
+   dma_buf_vunmap(obj->import_attach->dmabuf, map);
ret = -EIO;
goto err_put_pages;
}


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

2022-07-28 Thread Kevin Brace
 drivers/gpu/drm/via/Kconfig   |1 -
 drivers/gpu/drm/via/via_drv.c |   14 ++
 drivers/gpu/drm/via/via_drv.h |4 ++--
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit a3348cbe602f35bb404b7c47baa6551aeaddb0a5
Author: Kevin Brace 
Date:   Thu Jul 28 18:25:06 2022 -0700

drm/via: Version bumped to 3.5.8

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 59bc358e7a4b..baf4f9e4c120 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  7
+#define DRIVER_PATCHLEVEL  8
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20220725"
+#define DRIVER_DATE"20220728"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 16b3d68f95c9ccd15b7a3310e5d752fabbc76518
Author: Kevin Brace 
Date:   Thu Jul 28 17:50:38 2022 -0700

drm/via: Use drm_invalid_op() to handle discontinued uAPI requests

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index c569649cb8b1..1fa0d624b895 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -155,6 +155,20 @@ exit:
 }
 
 static const struct drm_ioctl_desc via_driver_ioctls[] = {
+   DRM_IOCTL_DEF_DRV(VIA_ALLOCMEM, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_FREEMEM, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_AGP_INIT, drm_invalid_op, DRM_AUTH | DRM_MASTER),
+   DRM_IOCTL_DEF_DRV(VIA_FB_INIT, drm_invalid_op, DRM_AUTH | DRM_MASTER),
+   DRM_IOCTL_DEF_DRV(VIA_MAP_INIT, drm_invalid_op, DRM_AUTH | DRM_MASTER),
+   DRM_IOCTL_DEF_DRV(VIA_DEC_FUTEX, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_DMA_INIT, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_CMDBUFFER, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_FLUSH, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_PCICMD, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_CMDBUF_SIZE, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_WAIT_IRQ, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_DMA_BLIT, drm_invalid_op, DRM_AUTH),
+   DRM_IOCTL_DEF_DRV(VIA_BLIT_SYNC, drm_invalid_op, DRM_AUTH),
DRM_IOCTL_DEF_DRV(VIA_GEM_CREATE, via_gem_create_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(VIA_GEM_MAP, via_gem_map_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
DRM_IOCTL_DEF_DRV(VIA_GEM_UNMAP, via_gem_unmap_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
commit 7bf7bb4ea22b1f64889bcb3c1ab0b3764c7d544b
Author: Kevin Brace 
Date:   Mon Jul 25 16:11:58 2022 -0700

drm/via: Hopefully the last white space removal from Kconfig

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/Kconfig b/drivers/gpu/drm/via/Kconfig
index 102088975f5b..7c4656a1d473 100644
--- a/drivers/gpu/drm/via/Kconfig
+++ b/drivers/gpu/drm/via/Kconfig
@@ -7,4 +7,3 @@ config DRM_OPENCHROME
  Choose this option if you have VIA Technologies UniChrome or
  Chrome9 integrated graphics. If M is selected the module will
  be called via.
-


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

2022-07-25 Thread Kevin Brace
 drivers/gpu/drm/via/via_drv.c   |   35 +++
 drivers/gpu/drm/via/via_drv.h   |   11 +--
 drivers/gpu/drm/via/via_ioctl.c |   27 +++
 3 files changed, 39 insertions(+), 34 deletions(-)

New commits:
commit b1857c6d763079ff7eeb3880ebaf04defb7ee7e4
Author: Kevin Brace 
Date:   Mon Jul 25 11:23:00 2022 -0700

drm/via: Version bumped to 3.5.7

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 8731e36ec826..59bc358e7a4b 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  6
+#define DRIVER_PATCHLEVEL  7
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE"20220709"
+#define DRIVER_DATE"20220725"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 4193fa52ac241726e432285912812d4ad0c404e0
Author: Kevin Brace 
Date:   Mon Jul 25 11:17:07 2022 -0700

drm/via: Move via_driver_ioctls{} to via_drv.c

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index af8f8db2eea9..c569649cb8b1 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -39,10 +39,10 @@
 
 #include 
 
-#include "via_drv.h"
+#include 
 
+#include "via_drv.h"
 
-extern const struct drm_ioctl_desc via_driver_ioctls[];
 
 /*
  * For now, this device driver will be disabled, unless the
@@ -154,6 +154,12 @@ exit:
return ret;
 }
 
+static const struct drm_ioctl_desc via_driver_ioctls[] = {
+   DRM_IOCTL_DEF_DRV(VIA_GEM_CREATE, via_gem_create_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
+   DRM_IOCTL_DEF_DRV(VIA_GEM_MAP, via_gem_map_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
+   DRM_IOCTL_DEF_DRV(VIA_GEM_UNMAP, via_gem_unmap_ioctl, DRM_AUTH | 
DRM_UNLOCKED),
+};
+
 static const struct file_operations via_driver_fops = {
.owner  = THIS_MODULE,
.open   = drm_open,
@@ -186,6 +192,7 @@ static struct drm_driver via_driver = {
DRIVER_ATOMIC,
 
.ioctls = via_driver_ioctls,
+   .num_ioctls = ARRAY_SIZE(via_driver_ioctls),
 
.fops = _driver_fops,
 };
@@ -301,8 +308,6 @@ static int __init via_init(void)
goto exit;
}
 
-   via_driver.num_ioctls = via_driver_num_ioctls;
-
ret = pci_register_driver(_pci_driver);
 
 exit:
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index e5e1fe0cf965..8731e36ec826 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -423,4 +423,11 @@ void via_ext_dvi_init(struct drm_device *dev);
 void via_tmds_init(struct drm_device *dev);
 void via_lvds_init(struct drm_device *dev);
 
+int via_gem_create_ioctl(struct drm_device *dev, void *data,
+   struct drm_file *file_priv);
+int via_gem_map_ioctl(struct drm_device *dev, void *data,
+   struct drm_file *file_priv);
+int via_gem_unmap_ioctl(struct drm_device *dev, void *data,
+   struct drm_file *file_priv);
+
 #endif /* _VIA_DRV_H */
diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index 24d72bf4d53a..3c772f73fbc0 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -25,7 +25,6 @@
  */
 
 #include 
-#include 
 
 #include 
 
@@ -34,9 +33,8 @@
 #include "via_drv.h"
 
 
-static int via_gem_create_ioctl(struct drm_device *dev,
-   void *data,
-   struct drm_file *file_priv)
+int via_gem_create_ioctl(struct drm_device *dev, void *data,
+   struct drm_file *file_priv)
 {
struct drm_via_gem_create *args = data;
struct ttm_buffer_object *ttm_bo;
@@ -71,9 +69,8 @@ exit:
return ret;
 }
 
-static int via_gem_map_ioctl(struct drm_device *dev,
-   void *data,
-   struct drm_file *file_priv)
+int via_gem_map_ioctl(struct drm_device *dev, void *data,
+   struct drm_file *file_priv)
 {
struct drm_via_gem_map *args = data;
struct drm_gem_object *gem;
@@ -96,9 +93,9 @@ exit:
return ret;
 }
 
-static int via_gem_unmap_ioctl(struct drm_device *dev,
-   void *data,
-   struct drm_file *file_priv)
+int via_gem_unmap_ioctl(struct drm_device *dev,
+   void *data,
+   struct drm_file *file_priv)
 {
struct drm_via_gem_unmap *args = data;
int ret;
@@ -110,13 +107,3 @@ static int via_gem_unmap_ioctl(struct d

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_tmds.c

2022-07-09 Thread Kevin Brace
 configure.ac   |2 +-
 src/via_tmds.c |   19 +--
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit dc661c59257e855cd9b29c14b91a8ee2d9b86ccb
Author: Kevin Brace 
Date:   Sat Jul 9 20:52:50 2022 -0500

Version bumped to 0.6.501

Put in a small fix for DVI on AGP based UniChrome (Pro) graphics.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 5309970..7af9956 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.500],
+[0.6.501],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit 2d34b73f979721856accbe9c9ab4738cccfd1e8c
Author: Kevin Brace 
Date:   Sat Jul 9 20:31:40 2022 -0500

Fix for DVI on AGP based UniChrome (Pro) graphics

Even with the use of strapping resistors, it is quite challenging to
automatically detect an external flat panel, TV encoder, or DVI
transmitter properly.  It turns out that there are complicated rules
to figure out if DVP0 is configured for DVI transmitter use.  The
configuration is not well documented even inside VIA Technologies
official documentation.  The code was tested on Wyse V10LE thin
client.  This model does not support ACPI S3 State (Suspend to RAM),
so it is not clear if the screen will recover properly when coming out
of standby.

Reported-by: Eric Kudzin 
Signed-off-by: Kevin Brace 

diff --git a/src/via_tmds.c b/src/via_tmds.c
index 749955b..32d6dfa 100644
--- a/src/via_tmds.c
+++ b/src/via_tmds.c
@@ -799,18 +799,17 @@ viaExtTMDSProbe(ScrnInfoPtr pScrn)
 case VIA_P4M800PRO:
 case VIA_PM800:
 case VIA_K8M800:
-/* 3C5.12[6] - DVP0D6 pin strapping
- * 0: Disable DVP0 (Digital Video Port 0) for
- *DVI or TV out use
- * 1: Enable DVP0 (Digital Video Port 0) for
- *DVI or TV out use
- * 3C5.12[5] - DVP0D5 pin strapping
- * 0: TMDS transmitter (DVI)
- * 1: TV encoder */
-if ((sr12 & BIT(6)) && (!(sr12 & BIT(5 {
+/*
+ * For DVP0 to be configured to not be used for a TV
+ * encoder, DVP0D[6] (SR12[6]) needs to be strapped
+ * low (0).  In addition, DVP0D[5] (SR12[5]) also needs
+ * to be strapped low (0) for DVP0 to be configured for
+ * DVI transmitter use.
+ */
+if (!(sr12 & BIT(6)) && (!(sr12 & BIT(5 {
 pVIADisplay->extTMDSDIPort = VIA_DI_PORT_DVP0;
 } else {
-pVIADisplay->extTMDSDIPort = VIA_DI_PORT_DVP1;
+pVIADisplay->extTMDSDIPort = VIA_DI_PORT_NONE;
 }
 
 break;


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 4 commits - drivers/gpu/drm

2022-07-09 Thread Kevin Brace
 drivers/gpu/drm/via/Kconfig   |6 -
 drivers/gpu/drm/via/via_drv.h |2 
 drivers/gpu/drm/via/via_encoder.c |1 
 drivers/gpu/drm/via/via_lvds.c|  192 --
 4 files changed, 4 insertions(+), 197 deletions(-)

New commits:
commit 10d8c010a84bfdb6376179622c1125b8cf6830ab
Author: Kevin Brace 
Date:   Sat Jul 9 19:19:50 2022 -0500

drm/via: Version bumped to 3.5.6

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 1746ed436014..e5e1fe0cf965 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,7 +50,7 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  5
+#define DRIVER_PATCHLEVEL  6
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome"
 #define DRIVER_DATE"20220709"
commit 443d3f5701b0cfcff307781603bb56dfad28cee0
Author: Kevin Brace 
Date:   Sat Jul 9 19:14:38 2022 -0500

drm/via: Slightly change the menuconfig display name for OpenChrome

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/Kconfig b/drivers/gpu/drm/via/Kconfig
index 15d6bac645ff..102088975f5b 100644
--- a/drivers/gpu/drm/via/Kconfig
+++ b/drivers/gpu/drm/via/Kconfig
@@ -1,5 +1,5 @@
 config DRM_OPENCHROME
-   tristate "OpenChrome (VIA Technologies)"
+   tristate "OpenChrome (VIA Technologies Chrome)"
depends on DRM && PCI && X86
select DRM_KMS_HELPER
select DRM_TTM
commit 13b87331c3f76b13870982272377e7f8ba80185a
Author: Kevin Brace 
Date:   Sat Jul 9 19:08:35 2022 -0500

drm/via: Eliminate unnecessary white spaces

This causes warnings in git when applying patches.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/Kconfig b/drivers/gpu/drm/via/Kconfig
index 760bf5906d3c..15d6bac645ff 100644
--- a/drivers/gpu/drm/via/Kconfig
+++ b/drivers/gpu/drm/via/Kconfig
@@ -4,7 +4,7 @@ config DRM_OPENCHROME
select DRM_KMS_HELPER
select DRM_TTM
help
- Choose this option if you have VIA Technologies UniChrome or 
- Chrome9 integrated graphics. If M is selected the module will 
+ Choose this option if you have VIA Technologies UniChrome or
+ Chrome9 integrated graphics. If M is selected the module will
  be called via.
 
diff --git a/drivers/gpu/drm/via/via_encoder.c 
b/drivers/gpu/drm/via/via_encoder.c
index 43c47e53b43e..32602136c170 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -222,4 +222,3 @@ void via_transmitter_display_source(struct via_drm_priv 
*dev_priv,
 
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
-
commit f39bb478372ef7a3aa126093a81e708b61db321e
Author: Kevin Brace 
Date:   Sat Jul 9 19:04:58 2022 -0500

drm/via: Remove unused functions from via_lvds.c
    
    This eliminates compilation warnings.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index ec18710428d4..5a582807a138 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -156,44 +156,6 @@ exit:
return ret;
 }
 
-/* caculate the cetering timing using mode and adjusted_mode */
-static void via_centering_timing(const struct drm_display_mode *mode,
-   struct drm_display_mode *adjusted_mode)
-{
-   int panel_hsync_time = adjusted_mode->hsync_end -
-   adjusted_mode->hsync_start;
-   int panel_vsync_time = adjusted_mode->vsync_end -
-   adjusted_mode->vsync_start;
-   int panel_hblank_start = adjusted_mode->hdisplay;
-   int panel_vbank_start = adjusted_mode->vdisplay;
-   int hborder = (adjusted_mode->hdisplay - mode->hdisplay) / 2;
-   int vborder = (adjusted_mode->vdisplay - mode->vdisplay) / 2;
-   int new_hblank_start = hborder + mode->hdisplay;
-   int new_vblank_start = vborder + mode->vdisplay;
-
-   adjusted_mode->hdisplay = mode->hdisplay;
-   adjusted_mode->hsync_start = (adjusted_mode->hsync_start -
-   panel_hblank_start) + new_hblank_start;
-   adjusted_mode->hsync_end = adjusted_mode->hsync_start +
-   panel_hsync_time;
-   adjusted_mode->vdisplay = mode->vdisplay;
-   adjusted_mode->vsync_start = (adjusted_mode->vsync_start -
-   panel_vbank_start) + new_vblank_start;
-   adjusted_mode->vsync_end = adjusted_mode->vsync_start +
-   panel_vsync_time;
-   /* Adjust Crtc H and V */
-   adjusted_mode->crtc_hdisplay = adjusted_mode->hdisplay;
-   adjusted_mode->crtc_hblank_start = new_hblank_start;
-   adjusted_mode->crtc_hblank_end = adjusted_mod

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 9 commits - drivers/gpu/drm

2022-07-05 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c|   15 +++-
 drivers/gpu/drm/via/via_crtc_hw.h |  142 ++
 drivers/gpu/drm/via/via_drv.h |8 +-
 drivers/gpu/drm/via/via_encoder.c |   52 +
 drivers/gpu/drm/via/via_lvds.c|7 +
 drivers/gpu/drm/via/via_sii164.c  |   15 
 drivers/gpu/drm/via/via_tmds.c|   18 ++--
 drivers/gpu/drm/via/via_vt1632.c  |   15 
 8 files changed, 256 insertions(+), 16 deletions(-)

New commits:
commit 61d1eeac0d426b2b8ce30aecf84b8532d4d55813
Author: Kevin Brace 
Date:   Tue Jul 5 17:13:17 2022 -0500

drm/via: Version bumped to 3.5.4

Added the necessary enablement code to support Silicon Image SiI 164
and VIA Technologies VT1632(A) DVI transmitter on CLE266 chipset.  Now
the KMS mode setting code should be display device support feature
parity with the legacy UMS mode setting code.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 1da0a191f9a8..5b4a1b0b8234 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  3
+#define DRIVER_PATCHLEVEL  4
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220701"
+#define DRIVER_DATE"20220705"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit a2d2af13895e861194fead01bbee9b8637578a0d
Author: Kevin Brace 
Date:   Tue Jul 5 16:59:03 2022 -0500

drm/via: Add via_clock_source() to specify DIPx clock source

Borrowed from OpenChrome DDX commit 7b385b3.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc_hw.h 
b/drivers/gpu/drm/via/via_crtc_hw.h
index 7fc75d574ba7..4a6b785324bd 100644
--- a/drivers/gpu/drm/via/via_crtc_hw.h
+++ b/drivers/gpu/drm/via/via_crtc_hw.h
@@ -188,6 +188,23 @@ via_dip0_set_output_enable(void __iomem *regs, bool 
output_enable)
output_enable ? "Enable" : "Disable");
 }
 
+/*
+ * Sets the clock source of DIP0 (Digital Interface Port 0)
+ * interface. CLE266 chipset only.
+ */
+static inline void
+via_dip0_set_clock_source(void __iomem *regs, bool clock_source)
+{
+   /*
+* 3X5.6C[5] - DIP0 Clock Source
+* 0: External
+* 1: Internal
+*/
+   svga_wcrt_mask(regs, 0x6c, clock_source ? BIT(5) : 0x00, BIT(5));
+   DRM_DEBUG_KMS("DIP0 Clock Source: %s\n",
+   clock_source ? "Internal" : "External");
+}
+
 /*
  * Sets the display source of DIP0 (Digital Interface Port 0) interface.
  * CLE266 chipset only.
@@ -242,6 +259,23 @@ via_dip1_set_output_enable(void __iomem *regs, bool 
output_enable)
output_enable ? "Enable" : "Disable");
 }
 
+/*
+ * Sets the clock source of DIP1 (Digital Interface Port 1)
+ * interface. CLE266 chipset only.
+ */
+static inline void
+via_dip1_set_clock_source(void __iomem *regs, bool clock_source)
+{
+   /*
+* 3X5.93[5] - DIP1 Clock Source
+* 0: External
+* 1: Internal
+*/
+   svga_wcrt_mask(regs, 0x93, clock_source ? BIT(5) : 0x00, BIT(5));
+   DRM_DEBUG_KMS("DIP1 Clock Source: %s\n",
+   clock_source ? "Internal" : "External");
+}
+
 /*
  * Sets the display source of DIP1 (Digital Interface Port 1)
  * interface. CLE266 chipset only.
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 878694da9ce5..1da0a191f9a8 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -363,6 +363,8 @@ void via_transmitter_io_pad_state(struct via_drm_priv 
*dev_priv,
uint32_t di_port, bool io_pad_on);
 void via_output_enable(struct via_drm_priv *dev_priv,
uint32_t di_port, bool output_enable);
+void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di_port,
+   bool clock_source);
 void via_transmitter_clock_drive_strength(struct via_drm_priv *dev_priv,
u32 di_port, u8 drive_strength);
 void via_transmitter_data_drive_strength(struct via_drm_priv *dev_priv,
diff --git a/drivers/gpu/drm/via/via_encoder.c 
b/drivers/gpu/drm/via/via_encoder.c
index b6db65ec8797..43c47e53b43e 100644
--- a/drivers/gpu/drm/via/via_encoder.c
+++ b/drivers/gpu/drm/via/via_encoder.c
@@ -109,6 +109,25 @@ void via_output_enable(struct via_drm_priv *dev_priv, 
uint32_t di_port,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
+void via_clock_source(struct via_drm_priv *dev_priv, uint32_t di

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 21 commits - drivers/gpu/drm include/drm/drm_pciids.h include/linux/pci_ids.h

2022-07-01 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c|  104 +++---
 drivers/gpu/drm/via/via_cursor.c  |   60 ++---
 drivers/gpu/drm/via/via_dac.c |   32 +--
 drivers/gpu/drm/via/via_display.c |2 
 drivers/gpu/drm/via/via_drv.c |   14 -
 drivers/gpu/drm/via/via_drv.h |   27 ++---
 drivers/gpu/drm/via/via_hdmi.c|   66 +---
 drivers/gpu/drm/via/via_init.c|   28 +-
 drivers/gpu/drm/via/via_lvds.c|   66 
 drivers/gpu/drm/via/via_pll.c |   20 +++
 drivers/gpu/drm/via/via_pm.c  |   12 ++--
 drivers/gpu/drm/via/via_tmds.c|   32 +--
 include/drm/drm_pciids.h  |   26 -
 include/linux/pci_ids.h   |   30 +-
 14 files changed, 229 insertions(+), 290 deletions(-)

New commits:
commit 582508da93d6f100a405cac498352571b5d88a36
Author: Kevin Brace 
Date:   Fri Jul 1 19:26:57 2022 -0500

drm/via: Version bumped to 3.5.3

Removed unnecessary code from integrated DVI / HDMI transmitter
support code.  Changed VIA Technologies PCI device ID labels to make it
more intuitive.  Brought PCI device detection table into via_drv.c.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index bee4e6dfb0e8..1c801d525a24 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  2
+#define DRIVER_PATCHLEVEL  3
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220620"
+#define DRIVER_DATE"20220701"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 12df952e58dbfd1ddfb5aa1090a02fea48e2316f
Author: Kevin Brace 
Date:   Fri Jul 1 19:21:29 2022 -0500

drm/via: Stop relying on drm_pciids.h for device detection

Bring the PCI device detection table directly into via_drv.c.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 25d7967c938b..dcb975439daa 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -185,7 +185,19 @@ static struct drm_driver via_driver = {
 };
 
 static struct pci_device_id via_pci_table[] = {
-   viadrv_PCI_IDS,
+   {0x1106, 0x3122, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x7205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3344, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3118, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3230, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x3157, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x1122, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x5122, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0x1106, 0x7122, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {0, 0, 0}
 };
 
 MODULE_DEVICE_TABLE(pci, via_pci_table);
commit 4bad0e24f9a419d2cb566f3ac05ad9cfcd37d17f
Author: Kevin Brace 
Date:   Fri Jul 1 18:51:41 2022 -0500

drm/via: Change VX800 chipset host bridge PCI device ID label

The new name is PCI_DEVICE_ID_VIA_VX800_HB since it is much easier to
remember.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_init.c b/drivers/gpu/drm/via/via_init.c
index cb960d39edbf..0e478b974628 100644
--- a/drivers/gpu/drm/via/via_init.c
+++ b/drivers/gpu/drm/via/via_init.c
@@ -855,7 +855,7 @@ int via_vram_detect(struct via_drm_priv *dev_priv)
/* P4M890 / VN890 */
case PCI_DEVICE_ID_VIA_P4M890:
/* VX800 / VX820 */
-   case PCI_DEVICE_ID_VIA_VT3353:
+   case PCI_DEVICE_ID_VIA_VX800_HB:
/* VX855 / VX875 */
case PCI_DEVICE_ID_VIA_VX855_HB:
ret = pci_read_config_byte(fn3, 0xA1, );
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index a37c790d29ad..3e6e6b19aea9 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1423,7 +1423,7 @@
 #define PCI_DEVICE_ID_VIA_VT3324   0x0324
 #define PCI_DEVICE_ID_VIA_VT3336   0x0336
 #define PCI_DEVICE_ID_VIA_VT3351   0x0351
-#define PCI_DEVICE_ID_VIA_VT3353   0x0353
+#define PCI_DEVICE_ID_VIA_VX800_HB 0x0353
 #define PCI_DEVICE_ID_VIA_VT3364   0x0364
 #define PCI_DEVICE_ID_VIA_8371_0   0x0391
 #define PCI_DEVICE_ID_VIA_VX855_HB 0x0409
commit b41ef25fc07e110d8d7e33d3de7d236678d37d5f
Author: Kevin Brace 
Date:   Fri Jul 1 18:51:39 2022 -0500

drm/via: Change VX855 chipset host bridge PCI device ID label

The new name is PCI_DEVICE_ID_VIA_VX855_HB since it is much easier to
remember

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 6 commits - drivers/gpu/drm

2022-06-20 Thread Kevin Brace
 drivers/gpu/drm/via/via_dac.c |   72 +-
 drivers/gpu/drm/via/via_display.c |   71 -
 drivers/gpu/drm/via/via_drv.c |9 +---
 drivers/gpu/drm/via/via_drv.h |6 +--
 drivers/gpu/drm/via/via_ioctl.c   |4 --
 drivers/gpu/drm/via/via_lvds.c|   58 ++
 drivers/gpu/drm/via/via_object.c  |   15 +++
 drivers/gpu/drm/via/via_tmds.c|   53 +++
 8 files changed, 193 insertions(+), 95 deletions(-)

New commits:
commit 53ebc0e97c37088271a608bdacc5e184cfecb8d2
Author: Kevin Brace 
Date:   Mon Jun 20 11:45:12 2022 -0500

drm/via: Version bumped to 3.5.2

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index b077e786d8bd..330ab8905417 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  1
+#define DRIVER_PATCHLEVEL  2
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220618"
+#define DRIVER_DATE"20220620"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 79eda72f3642ef2f3dc65bb67f5bdb175d495fad
Author: Kevin Brace 
Date:   Mon Jun 20 11:35:44 2022 -0500

drm/via: Miscellaneous cleanups related to via_bo_create()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index b38b92dda18a..25d7967c938b 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -103,13 +103,8 @@ static int via_driver_dumb_create(struct drm_file 
*file_priv,
pitch = args->width * ((args->bpp + 7) >> 3);
size = pitch * args->height;
 
-   ret = via_bo_create(dev,
-   _priv->bdev,
-   size,
-   ttm_bo_type_device,
-   TTM_PL_VRAM,
-   false,
-   );
+   ret = via_bo_create(dev, _priv->bdev, size,
+   ttm_bo_type_device, TTM_PL_VRAM, false, );
if (ret) {
goto exit;
}
diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index 6910b4aa6ef4..24d72bf4d53a 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -48,9 +48,7 @@ static int via_gem_create_ioctl(struct drm_device *dev,
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
ret = via_bo_create(dev, _priv->bdev, args->size,
-   ttm_bo_type_device, args->domain, false,
-   );
-
+   ttm_bo_type_device, args->domain, false, );
if (ret) {
goto exit;
}
diff --git a/drivers/gpu/drm/via/via_object.c b/drivers/gpu/drm/via/via_object.c
index 0f96df8da786..96fb2934d0de 100644
--- a/drivers/gpu/drm/via/via_object.c
+++ b/drivers/gpu/drm/via/via_object.c
@@ -166,12 +166,12 @@ void via_bo_unpin(struct via_bo *bo)
 }
 
 int via_bo_create(struct drm_device *dev,
-   struct ttm_device *bdev,
-   uint64_t size,
-   enum ttm_bo_type type,
-   uint32_t ttm_domain,
-   bool kmap,
-   struct via_bo **bo_ptr)
+   struct ttm_device *bdev,
+   uint64_t size,
+   enum ttm_bo_type type,
+   uint32_t ttm_domain,
+   bool kmap,
+   struct via_bo **bo_ptr)
 {
struct ttm_buffer_object *ttm_bo;
struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
@@ -180,7 +180,6 @@ int via_bo_create(struct drm_device *dev,
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-// bo = kzalloc(sizeof(struct via_bo), GFP_KERNEL);
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
if (!bo) {
DRM_ERROR("Cannot allocate a TTM buffer object.\n");
@@ -191,7 +190,7 @@ int via_bo_create(struct drm_device *dev,
ttm_bo = >ttm_bo;
 
/*
-* It is imperative to page align the requested buffer size
+* It is an imperative to page align the requested buffer size
 * prior to a memory allocation request, or various memory
 * allocation related system instabilities may occur.
 */
commit eae4afc1d49a13231e77f0f5c121cb8bcc91bc3f
Author: Kevin Brace 
Date:   Mon Jun 20 11:35:41 2022 -0500

drm/via: Delete via_connector

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 19 commits - drivers/gpu/drm

2022-06-18 Thread Kevin Brace
 drivers/gpu/drm/via/via_crtc.c|   56 +++
 drivers/gpu/drm/via/via_crtc_hw.c |6 +-
 drivers/gpu/drm/via/via_crtc_hw.h |4 +
 drivers/gpu/drm/via/via_cursor.c  |   56 ++-
 drivers/gpu/drm/via/via_dac.c |6 +-
 drivers/gpu/drm/via/via_display.c |8 ++-
 drivers/gpu/drm/via/via_drv.c |   28 ++-
 drivers/gpu/drm/via/via_drv.h |   46 ---
 drivers/gpu/drm/via/via_encoder.c |9 +--
 drivers/gpu/drm/via/via_hdmi.c|8 ++-
 drivers/gpu/drm/via/via_i2c.c |   20 ++--
 drivers/gpu/drm/via/via_init.c|   13 +++--
 drivers/gpu/drm/via/via_ioctl.c   |   61 +++--
 drivers/gpu/drm/via/via_lvds.c|8 ++-
 drivers/gpu/drm/via/via_object.c  |   92 --
 drivers/gpu/drm/via/via_pll.c |   37 +--
 drivers/gpu/drm/via/via_pm.c  |   40 +++-
 drivers/gpu/drm/via/via_regs.h|5 --
 drivers/gpu/drm/via/via_sii164.c  |9 +--
 drivers/gpu/drm/via/via_tmds.c|8 +--
 drivers/gpu/drm/via/via_ttm.c |   40 +++-
 drivers/gpu/drm/via/via_vt1632.c  |9 +--
 22 files changed, 281 insertions(+), 288 deletions(-)

New commits:
commit fc56960114c0e596963a35f8d07f93a88eb51aa2
Author: Kevin Brace 
Date:   Sat Jun 18 18:51:56 2022 -0500

drm/via: Version bumped to 3.5.1

Cleaned up file header sections to properly acknowledge copyright,
authorship, and licensing terms.  Switched the module license to GPL.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index dbda1f666e56..8993844d6b74 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   5
-#define DRIVER_PATCHLEVEL  0
+#define DRIVER_PATCHLEVEL  1
 #define DRIVER_NAME"via"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220607"
+#define DRIVER_DATE"20220618"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit a33763eba400f9417ff70627c85c156a4b1cbcd1
Author: Kevin Brace 
Date:   Sat Jun 18 18:51:54 2022 -0500

drm/via: Destroy a BO if a GEM handle was not acquired

Forgot to destroy a BO of the dumb buffer if acquiring a GEM handle
for it failed.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 68a8d9ac177c..b38b92dda18a 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -119,6 +119,7 @@ static int via_driver_dumb_create(struct drm_file 
*file_priv,
ret = drm_gem_handle_create(file_priv, _bo->base, );
drm_gem_object_put(_bo->base);
if (ret) {
+   via_bo_destroy(bo, false);
goto exit;
}
 
commit 09e8214227828a6e1cc7c826cb6dc75e657e6e6f
Author: Kevin Brace 
Date:   Sat Jun 18 18:51:52 2022 -0500

drm/via: Use *ttm_bo to access itself and its members

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index 76823a6c1492..afd42bd99f25 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -1912,7 +1912,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
via_iga1_set_color_depth(dev_priv, fb->format->depth);
 
/* Set the framebuffer offset */
-   addr = round_up((bo->ttm_bo.resource->start << PAGE_SHIFT) +
+   addr = round_up((ttm_bo->resource->start << PAGE_SHIFT) +
pitch, 16) >> 1;
 
vga_wcrt(VGABASE, 0x0D, addr & 0xFF);
@@ -1936,7 +1936,7 @@ void via_primary_atomic_update(struct drm_plane *plane,
via_iga2_set_color_depth(dev_priv, fb->format->depth);
 
/* Set the framebuffer offset */
-   addr = round_up((bo->ttm_bo.resource->start << PAGE_SHIFT) +
+   addr = round_up((ttm_bo->resource->start << PAGE_SHIFT) +
pitch, 16);
/* Bits 9 to 3 of the frame buffer go into bits 7 to 1
 * of the register. Bit 0 is for setting tile mode or
@@ -1976,13 +1976,13 @@ static int via_primary_prepare_fb(struct drm_plane 
*plane,
ttm_bo = container_of(gem, struct ttm_buffer_object, base);
bo = to_ttm_bo(ttm_bo);
 
-   ret = ttm_bo_reserve(>ttm_bo, true, false, NULL);
+   ret = ttm_bo_reserve(ttm_bo, true, false, NULL);
if (ret) {
goto exit;
}
 
ret = via_bo_pin(bo, TTM_PL_VRAM);
-   ttm_bo_unreserve(>ttm_bo);
+   ttm_bo_unreserve(ttm_bo);
 exit:
DRM_DEBUG_KMS("Exiting %

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 3 commits - configure.ac src/openchrome_drm.h src/via_driver.c src/via_driver.h src/via_drm.h src/via_memmgr.c tools/registers.c

2022-06-08 Thread Kevin Brace
 configure.ac |2 
 src/openchrome_drm.h |   75 -
 src/via_driver.c |  113 +--
 src/via_driver.h |3 -
 src/via_drm.h|   35 +--
 src/via_memmgr.c |   21 -
 tools/registers.c|3 -
 7 files changed, 76 insertions(+), 176 deletions(-)

New commits:
commit 422d028257c27952460fa9a35a7291212db43982
Author: Kevin Brace 
Date:   Wed Jun 8 13:42:37 2022 -0500

Version bumped to 0.6.500

Discontinue the use of 'openchrome' based OpenChrome DRM.  'via' based
OpenChrome DRM Version 3.5.0 will replace it.  Its uAPI will also change
as a result.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 0d01bd3..5309970 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.411],
+[0.6.500],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit 04c73010c6ea30a27dda3cd01cfd68e864206df4
Author: Kevin Brace 
Date:   Wed Jun 8 13:42:37 2022 -0500

Use 'via' based OpenChrome DRM only from now on

Discontinue the use of 'openchrome' based OpenChrome DRM.
Its uAPI will also change as a result.

Signed-off-by: Kevin Brace 

diff --git a/src/openchrome_drm.h b/src/openchrome_drm.h
deleted file mode 100644
index bfa296e..000
--- a/src/openchrome_drm.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright © 2020 Kevin Brace
- *
- * 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 
- */
-
-#ifndef __OPENCHROME_DRM_H__
-#define __OPENCHROME_DRM_H__
-
-
-#include "drm.h"
-
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-
-#define DRM_OPENCHROME_GEM_CREATE  0x00
-#define DRM_OPENCHROME_GEM_MAP 0x01
-#define DRM_OPENCHROME_GEM_UNMAP   0x02
-
-
-#define DRM_IOCTL_OPENCHROME_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + 
DRM_OPENCHROME_GEM_CREATE, struct drm_openchrome_gem_create)
-#define DRM_IOCTL_OPENCHROME_GEM_MAPDRM_IOWR(DRM_COMMAND_BASE + 
DRM_OPENCHROME_GEM_MAP, struct drm_openchrome_gem_map)
-#define DRM_IOCTL_OPENCHROME_GEM_UNMAP  DRM_IOR(DRM_COMMAND_BASE + 
DRM_OPENCHROME_GEM_UNMAP, struct drm_openchrome_gem_unmap)
-
-
-struct drm_openchrome_gem_create {
-   uint64_t size;
-   uint32_t alignment;
-   uint32_t domain;
-   uint32_t handle;
-   uint64_t offset;
-};
-
-struct drm_openchrome_gem_map {
-   uint32_t handle;
-   uint64_t map_offset;
-};
-
-struct drm_openchrome_gem_unmap {
-   uint32_t handle;
-};
-
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* __OPENCHROME_DRM_H__ */
diff --git a/src/via_driver.c b/src/via_driver.c
index e50cbfd..a24e2cf 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -65,7 +65,7 @@
 #ifdef OPENCHROMEDRI
 static const ViaDRMVersion drmVIADRMExpected = { 1, 3, 0 };
 static const ViaDRMVersion drmVIADRMCompat = { 3, 0, 0 };
-static const ViaDRMVersion drmOpenChromeDRMVersion = { 3, 4, 0 };
+static const ViaDRMVersion drmVIADRMKMSSupport = { 3, 5, 0 };
 #endif /* OPENCHROMEDRI */
 
 /* Prototypes. */
@@ -870,120 +870,69 @@ viaDrmOpen(ScrnInfoPtr pScrn)
 pVia->PciInfo->func);
 }
 
-/*
- * Look for OpenChrome DRM first.
- * KMS supports needs to be present for OpenChrome DRM to
- * function properly.
- */
-pVia->drmmode.fd = drmOpen(OPENCHROME_DRM_DRIVER_NAME, busId);
+busId = DRICreatePCIBusID(pVia->PciInfo);
+pVia->drmmode.fd = drmOpen(VIA_DRM_DRIVER_NAME, busId);
 if (pVia->drmmode.fd != -1) {
 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"OpenChrome DRM detected.\n");
+"Co

[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.20'

2022-06-06 Thread Kevin Brace
New branch 'drm-next-5.20' available with the following commits:


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_memmgr.c src/via_ums.c

2022-06-04 Thread Kevin Brace
 configure.ac |2 +-
 src/via_memmgr.c |4 ++--
 src/via_ums.c|2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 9499683acdaa133385457bc7e35ce52d656f280b
Author: Kevin Brace 
Date:   Sat Jun 4 18:24:35 2022 -0500

Version bumped to 0.6.411

Put in a fix that will make explicitly disabling acceleration via
xorg.conf work properly again.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 0602cae..0d01bd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.410],
+[0.6.411],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit 4100db9adf1c4e26bd966a55db3b8e79ad426e69
Author: Kevin Brace 
Date:   Sat Jun 4 18:24:35 2022 -0500

Fix for explicitly disabling acceleration causing a crash

Explicitly disabling acceleration via xorg.conf was causing X Server
to crash during boot up.

Signed-off-by: Kevin Brace 

diff --git a/src/via_memmgr.c b/src/via_memmgr.c
index ea1ba86..343370e 100644
--- a/src/via_memmgr.c
+++ b/src/via_memmgr.c
@@ -93,7 +93,7 @@ drm_bo_alloc(ScrnInfoPtr pScrn, unsigned long size,
 case TTM_PL_TT:
 case TTM_PL_VRAM:
 if (pVia->directRenderingType == DRI_NONE) {
-if (!pVia->useEXA) {
+if ((pVia->NoAccel) || (!pVia->useEXA)) {
 ret = viaOffScreenLinear(pScrn, obj,
 size, alignment);
 if (ret) {
@@ -299,7 +299,7 @@ drm_bo_free(ScrnInfoPtr pScrn, struct buffer_object *obj)
 case TTM_PL_VRAM:
 case TTM_PL_TT:
 if (pVia->directRenderingType == DRI_NONE) {
-if (!pVia->useEXA) {
+if ((pVia->NoAccel) || (!pVia->useEXA)) {
 FBLinearPtr linear = (FBLinearPtr) obj->handle;
 
 xf86FreeOffscreenLinear(linear);
diff --git a/src/via_ums.c b/src/via_ums.c
index c7e5d56..0c1adce 100644
--- a/src/via_ums.c
+++ b/src/via_ums.c
@@ -856,7 +856,7 @@ viaUMSScreenInit(ScrnInfoPtr pScrn)
 "Entered %s.\n", __func__));
 
 if (pVia->directRenderingType == DRI_NONE) {
-if (!pVia->useEXA) {
+if ((pVia->NoAccel) || (!pVia->useEXA)) {
 if (!viaInitFB(pScrn)) {
 ret = FALSE;
 }


[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.19'

2022-05-20 Thread Kevin Brace
New branch 'drm-next-5.19' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.18' - 5 commits - drivers/gpu/drm

2022-05-20 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_analog.c  |   53 +---
 drivers/gpu/drm/openchrome/openchrome_clocks.c  |4 -
 drivers/gpu/drm/openchrome/openchrome_crtc.c|   38 +
 drivers/gpu/drm/openchrome/openchrome_cursor.c  |8 +--
 drivers/gpu/drm/openchrome/openchrome_display.c |6 +-
 drivers/gpu/drm/openchrome/openchrome_drv.c |   25 +++
 drivers/gpu/drm/openchrome/openchrome_drv.h |9 ++--
 drivers/gpu/drm/openchrome/openchrome_fp.c  |   45 ++--
 drivers/gpu/drm/openchrome/openchrome_hdmi.c|   16 ---
 drivers/gpu/drm/openchrome/openchrome_i2c.c |   12 +++--
 drivers/gpu/drm/openchrome/openchrome_init.c|   34 ---
 drivers/gpu/drm/openchrome/openchrome_ioctl.c   |3 -
 drivers/gpu/drm/openchrome/openchrome_object.c  |5 +-
 drivers/gpu/drm/openchrome/openchrome_pm.c  |5 +-
 drivers/gpu/drm/openchrome/openchrome_sii164.c  |   18 +---
 drivers/gpu/drm/openchrome/openchrome_tmds.c|   34 +--
 drivers/gpu/drm/openchrome/openchrome_vt1632.c  |   18 +---
 17 files changed, 191 insertions(+), 142 deletions(-)

New commits:
commit 529d1fc221aff08944cd817e4aec04d728a51ddd
Author: Kevin Brace 
Date:   Fri May 20 11:56:43 2022 -0500

drm/openchrome: Version bumped to 3.4.19

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index e3b21826d4e4..e1081359d660 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -54,10 +54,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   4
-#define DRIVER_PATCHLEVEL  18
+#define DRIVER_PATCHLEVEL  19
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220209"
+#define DRIVER_DATE"20220519"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 1fdd81f16d24347ca19379fe1422e775fad98905
Author: Kevin Brace 
Date:   Fri May 20 11:56:41 2022 -0500

drm/openchrome: Use devm_drm_dev_alloc

Based on commit cd82945 (drm/aspeed: Use devm_drm_dev_alloc).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c 
b/drivers/gpu/drm/openchrome/openchrome_analog.c
index 83438c38d5a4..d21e9966a6ee 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -108,8 +108,9 @@ static const struct drm_encoder_funcs via_dac_enc_funcs = {
 static void
 via_analog_dpms(struct drm_encoder *encoder, int mode)
 {
+   struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
-   encoder->dev->dev_private;
+   to_openchrome_private(dev);
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
@@ -159,8 +160,9 @@ via_analog_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
 {
+   struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
-   encoder->dev->dev_private;
+   to_openchrome_private(dev);
struct via_crtc *iga = container_of(encoder->crtc, struct via_crtc, 
base);
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -174,8 +176,9 @@ via_analog_mode_set(struct drm_encoder *encoder,
 static void
 via_analog_prepare(struct drm_encoder *encoder)
 {
+   struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
-   encoder->dev->dev_private;
+   to_openchrome_private(dev);
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
@@ -190,8 +193,9 @@ via_analog_prepare(struct drm_encoder *encoder)
 static void
 via_analog_commit(struct drm_encoder *encoder)
 {
+   struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
-   encoder->dev->dev_private;
+   to_openchrome_private(dev);
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
@@ -206,8 +210,9 @@ via_analog_commit(struct drm_encoder *encoder)
 static void
 via_analog_disable(struct drm_encoder *encoder)
 {
+   struct drm_device *dev = encoder->dev;
struct openchrome_drm_private *dev_private =
-   encoder->dev->dev_private;
+   to_openchrome_private(dev);
 
DRM_DEBUG_KMS("Entered %s

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.18' - 13 commits - drivers/gpu/drm drivers/video/fbdev

2022-03-31 Thread Kevin Brace
 drivers/gpu/drm/drm_edid.c|   15 +++
 drivers/gpu/drm/i915/display/intel_bw.c   |3 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c |9 ++
 drivers/gpu/drm/i915/i915_drv.h   |2 -
 drivers/gpu/drm/i915/intel_pm.c   |   10 ---
 drivers/gpu/drm/selftests/test-drm_plane_helper.c |8 +++---
 drivers/gpu/drm/ttm/ttm_range_manager.c   |2 -
 drivers/video/fbdev/core/cfbimgblt.c  |   28 ++---
 drivers/video/fbdev/core/sysimgblt.c  |   29 ++
 9 files changed, 82 insertions(+), 24 deletions(-)

New commits:
commit 8aae26eb28c2ed9b0f7255996f3b28507e25a091
Merge: 4b8a41957011 2a81dba4b577
Author: Kevin Brace 
Date:   Thu Mar 31 17:49:27 2022 -0700

Merge tag 'drm-next-2022-03-25' of git://anongit.freedesktop.org/drm/drm 
into drm-next-5.18

drm fixes for 5.18-rc1

core:
- Make audio and color plane support checking only happen
  when a CEA extension block is found.
- Small selftest fix.

fbdev:
- two regressions fixes from speedup patches.

ttm:
- Fix a small regression from ttm_resource_fini()

i915:
- Reject unsupported TMDS rates on ICL+
- Treat SAGV block time 0 as SAGV disabled
- Fix PSF GV point mask when SAGV is not possible
- Fix renamed INTEL_INFO->media.arch/ver field

commit 2a81dba4b577099717cea86d429f053e85e74d96
Author: Thomas Zimmermann 
Date:   Sun Mar 13 20:29:52 2022 +0100

fbdev: Fix cfb_imageblit() for arbitrary image widths

Commit 0d03011894d2 ("fbdev: Improve performance of cfb_imageblit()")
broke cfb_imageblit() for image widths that are not aligned to 8-bit
boundaries. Fix this by handling the trailing pixels on each line
separately. The performance improvements in the original commit do not
regress by this change.

Signed-off-by: Thomas Zimmermann 
Fixes: 0d03011894d2 ("fbdev: Improve performance of cfb_imageblit()")
Reported-by: Marek Szyprowski 
Cc: Thomas Zimmermann 
Cc: Javier Martinez Canillas 
Cc: Sam Ravnborg 
Tested-by: Marek Szyprowski 
Acked-by: Daniel Vetter 
Reviewed-by: Javier Martinez Canillas 
Tested-by: Guenter Roeck 
Signed-off-by: Dave Airlie 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20220313192952.12058-3-tzimmerm...@suse.de

diff --git a/drivers/video/fbdev/core/cfbimgblt.c 
b/drivers/video/fbdev/core/cfbimgblt.c
index 7361cfabdd85..9ebda4e0dc7a 100644
--- a/drivers/video/fbdev/core/cfbimgblt.c
+++ b/drivers/video/fbdev/core/cfbimgblt.c
@@ -218,7 +218,7 @@ static inline void fast_imageblit(const struct fb_image 
*image, struct fb_info *
 {
u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
-   u32 bit_mask, eorx;
+   u32 bit_mask, eorx, shift;
const char *s = image->data, *src;
u32 __iomem *dst;
const u32 *tab = NULL;
@@ -259,17 +259,23 @@ static inline void fast_imageblit(const struct fb_image 
*image, struct fb_info *
 
for (i = image->height; i--; ) {
dst = (u32 __iomem *)dst1;
+   shift = 8;
src = s;
 
+   /*
+* Manually unroll the per-line copying loop for better
+* performance. This works until we processed the last
+* completely filled source byte (inclusive).
+*/
switch (ppw) {
case 4: /* 8 bpp */
-   for (j = k; j; j -= 2, ++src) {
+   for (j = k; j >= 2; j -= 2, ++src) {
FB_WRITEL(colortab[(*src >> 4) & bit_mask], 
dst++);
FB_WRITEL(colortab[(*src >> 0) & bit_mask], 
dst++);
}
break;
case 2: /* 16 bpp */
-   for (j = k; j; j -= 4, ++src) {
+   for (j = k; j >= 4; j -= 4, ++src) {
FB_WRITEL(colortab[(*src >> 6) & bit_mask], 
dst++);
FB_WRITEL(colortab[(*src >> 4) & bit_mask], 
dst++);
FB_WRITEL(colortab[(*src >> 2) & bit_mask], 
dst++);
@@ -277,7 +283,7 @@ static inline void fast_imageblit(const struct fb_image 
*image, struct fb_info *
}
break;
case 1: /* 32 bpp */
-   for (j = k; j; j -= 8, ++src) {
+   for (j = k; j >= 8; j -= 8, ++src) {
FB_WRITEL(colortab[(*src >> 7) & bit_mask], 
dst++);
FB_WRITEL(colortab[(*src >> 6) & bit_mask], 
dst++);
FB_WRI

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_display.c

2022-02-09 Thread Kevin Brace
 configure.ac  |2 +-
 src/via_display.c |9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 1d4d0bcf9b00083b8cc8ee90bf445ecb52bced81
Author: Kevin Brace 
Date:   Wed Feb 9 17:10:24 2022 -0600

Version bumped to 0.6.410

This version fixes a bug that prevented xrandr from adjusting
brightness and gamma parameters.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index e6888e9..0602cae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.409],
+[0.6.410],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit be4848075f312a4036a9d1a3528be1443c80a638
Author: Kevin Brace 
Date:   Wed Feb 9 16:54:30 2022 -0600

Revert commit 7a55ef1 (gamma correction)

It was reported that commit 7a55ef1 (Turning off gamma correction
for both IGA1 and IGA2) broke the ability of xrandr to adjust its
brightness parameter.  It turns out gamma parameter also stopped
working.  Since the related code has changed a lot, do an equivalent
code revert to revert the commit.

Suggested-by: RBZ 
Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index 3ef093e..4054fb4 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3412,6 +3412,15 @@ via_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 
*green, CARD16 *blue,
 
 VIALoadRgbLut(pScrn, 0, size, colors);
 
+/*
+ * Turn gamma correction on.
+ */
+if (!iga->index) {
+viaIGA1SetGamma(pScrn, TRUE);
+} else {
+viaIGA2SetGamma(pScrn, TRUE);
+}
+
 DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 "Exiting %s.\n", __func__));
 }


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.18' - 12 commits - drivers/gpu/drm

2022-02-01 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_analog.c  |2 
 drivers/gpu/drm/openchrome/openchrome_clocks.c  |2 
 drivers/gpu/drm/openchrome/openchrome_crtc.c|   52 
 drivers/gpu/drm/openchrome/openchrome_cursor.c  |1 
 drivers/gpu/drm/openchrome/openchrome_display.c |2 
 drivers/gpu/drm/openchrome/openchrome_drv.c |5 +-
 drivers/gpu/drm/openchrome/openchrome_drv.h |   23 --
 drivers/gpu/drm/openchrome/openchrome_encoder.c |2 
 drivers/gpu/drm/openchrome/openchrome_fp.c  |1 
 drivers/gpu/drm/openchrome/openchrome_hdmi.c|2 
 drivers/gpu/drm/openchrome/openchrome_init.c|4 -
 drivers/gpu/drm/openchrome/openchrome_ioctl.c   |2 
 drivers/gpu/drm/openchrome/openchrome_pm.c  |1 
 drivers/gpu/drm/openchrome/openchrome_tmds.c|2 
 14 files changed, 46 insertions(+), 55 deletions(-)

New commits:
commit 94bb7d9935900b29fa034012ffbbf1552cc1b550
Author: Kevin Brace 
Date:   Tue Feb 1 14:03:22 2022 -0600

drm/openchrome: Version bumped to 3.4.17

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 3f46b47aef84..b63c08bb39c0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -54,10 +54,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   4
-#define DRIVER_PATCHLEVEL  16
+#define DRIVER_PATCHLEVEL  17
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220125"
+#define DRIVER_DATE"20220201"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 1a8e0e9ba54110ae0d1b9aaf6a6c6a79ef943cd7
Author: Kevin Brace 
Date:   Tue Feb 1 13:53:59 2022 -0600

drm/openchrome: Consolidate access to SR1A in openchrome_gamma_set()

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 22f8166f7b38..ce23075bb9e6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -192,25 +192,26 @@ static int openchrome_gamma_set(struct drm_crtc *crtc,
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
int end = (size > 256) ? 256 : size, i;
-   u8 val = 0, sr1a;
+   u8 val = 0;
int ret = 0;
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   sr1a = vga_rseq(VGABASE, 0x1A);
-
if ((!crtc->enabled) || (!crtc->primary->fb)) {
ret = -EINVAL;
goto exit;
}
 
if (!iga->index) {
+   /*
+* Access IGA1's pallette LUT.
+*/
+   svga_wseq_mask(VGABASE, 0x1A, 0x00, BIT(0));
+
/*
 * Is it an 8-bit color mode?
 */
if (crtc->primary->fb->format->cpp[0] == 1) {
-   /* Prepare for initialize IGA1's LUT: */
-   vga_wseq(VGABASE, 0x1A, sr1a & 0xFE);
/* Change to Primary Display's LUT */
val = vga_rseq(VGABASE, 0x1B);
vga_wseq(VGABASE, 0x1B, val);
@@ -233,12 +234,9 @@ static int openchrome_gamma_set(struct drm_crtc *crtc,
 * previously
 */
svga_wcrt_mask(VGABASE, 0x33, 0x00, BIT(7));
-   /* access Primary Display's LUT */
-   vga_wseq(VGABASE, 0x1A, sr1a & 0xFE);
} else {
/* Enable Gamma */
svga_wcrt_mask(VGABASE, 0x33, BIT(7), BIT(7));
-   svga_wseq_mask(VGABASE, 0x1A, 0x00, BIT(0));
 
/* Fill in IGA1's gamma */
for (i = 0; i < end; i++) {
@@ -249,15 +247,17 @@ static int openchrome_gamma_set(struct drm_crtc *crtc,
vga_w(VGABASE, VGA_PEL_D, g[i] >> 8);
vga_w(VGABASE, VGA_PEL_D, b[i] >> 8);
}
-   vga_wseq(VGABASE, 0x1A, sr1a);
}
} else {
+   /*
+* Access IGA2's pallette LUT.
+*/
+   svga_wseq_mask(VGABASE, 0x1A, BIT(0), BIT(0));
+
/*
 * Is it an 8-bit color mode?
 */
if (crtc->primary->fb->format->cpp[0] == 1) {
-   /* Change Shadow to Secondary Display's LUT */
-   svga_wseq_mask(VGABASE, 0x1A, BIT(0), BIT(0));
/* Enable Secondary Display Engine */
  

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

2022-01-25 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_drv.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ed3211a6fc8111854149dcdef4b4492963c50668
Author: Kevin Brace 
Date:   Tue Jan 25 16:35:17 2022 -0600

drm/openchrome: Version bumped to 3.4.16

Previous patch level did not completely eliminate openchrome_fb.c.
This one does.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 10fd7958e3f3..15624d9eb84b 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  15
+#define DRIVER_PATCHLEVEL  16
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220121"
+#define DRIVER_DATE"20220125"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 3b0c41761708806138b39ad4673683c939e644a4
Author: Kevin Brace 
Date:   Tue Jan 25 16:32:26 2022 -0600

drm/openchrome: Delete openchrome_fb.c again

Move the remaining openchrome_mode_config_init() into openchrome_init.c.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/Makefile 
b/drivers/gpu/drm/openchrome/Makefile
index 57cafce15d2d..7624fedde5d4 100644
--- a/drivers/gpu/drm/openchrome/Makefile
+++ b/drivers/gpu/drm/openchrome/Makefile
@@ -11,7 +11,6 @@ openchrome-y := openchrome_analog.o \
openchrome_display.o \
openchrome_drv.o \
openchrome_encoder.o \
-   openchrome_fb.o \
openchrome_fp.o \
openchrome_hdmi.o \
openchrome_i2c.o \
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 2d485215474c..10fd7958e3f3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -378,6 +378,8 @@ void openchrome_graphics_unlock(
 void chip_revision_info(struct openchrome_drm_private *dev_private);
 int openchrome_device_init(struct openchrome_drm_private *dev_private);
 void openchrome_device_fini(struct openchrome_drm_private *dev_private);
+void openchrome_mode_config_init(
+   struct openchrome_drm_private *dev_private);
 int openchrome_drm_init(struct drm_device *dev);
 void openchrome_drm_fini(struct drm_device *dev);
 
@@ -439,10 +441,6 @@ void via_i2c_exit(void);
 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);
-
 /* crtc */
 void via_load_crtc_pixel_timing(struct drm_crtc *crtc,
struct drm_display_mode *mode);
diff --git a/drivers/gpu/drm/openchrome/openchrome_fb.c 
b/drivers/gpu/drm/openchrome/openchrome_fb.c
deleted file mode 100644
index 7277a69601a7..
--- a/drivers/gpu/drm/openchrome/openchrome_fb.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2012 James Simmons . 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, sub license,
- * 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHOR(S) OR COPYRIGHT HOLDER(S) 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.
- */
-
-#include 
-#include 
-#include 
-#include 
-
-#include "openchrome_drv.h"
-
-
-static const struct drm_mode_config_funcs openchrome_drm_mode_config_funcs = {
-   .fb_create  = drm_gem_fb_create,
-   .atomic_check   = drm_atomic_helper_check,
-   .atomic_commit  = drm_atomic_helper_commit,
-};
-
-void openchrome_mode_config_init(
-   struct openchrome_drm_private *dev_private)
-{
-   s

[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.18'

2022-01-24 Thread Kevin Brace
New branch 'drm-next-5.18' available with the following commits:
commit 759ef9b8919f4628e6b90b4c6ca8e12abd1ba468
Author: Kevin Brace 
Date:   Fri Jan 21 19:07:34 2022 -0600

drm/openchrome: Version bumped to 3.4.15

Adopted DRM FBDEV helpers to reduce code duplication.

Signed-off-by: Kevin Brace 

commit 55d61db313bc768bc696ceec2f3397aebce35741
Author: Kevin Brace 
Date:   Fri Jan 21 18:56:16 2022 -0600

drm/openchrome: Delete openchrome_fb.c

Move the remaining openchrome_mode_config_init() into openchrome_init.c.

Signed-off-by: Kevin Brace 

commit 26804903a56c03804683ea67736c4a2638e7348d
Author: Kevin Brace 
Date:   Fri Jan 21 18:23:37 2022 -0600

drm/openchrome: Adopt DRM FBDEV helpers

It appears the existing FBDEV emulation code offers no advantage over
provided DRM FBDEV helper code.  Remove the existing code and adopt
DRM FBDEV helper code.  This reduces code duplication.

Signed-off-by: Kevin Brace 



[openchrome-devel] drm-openchrome: Branch 'drm-next-5.17' - 7 commits - drivers/gpu/drm

2022-01-21 Thread Kevin Brace
 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 
Date:   Fri Jan 21 16:42:23 2022 -0600

drm/openchrome: Version bumped to 3.4.14

Signed-off-by: Kevin Brace 

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 
Date:   Fri Jan 21 16:38:03 2022 -0600

drm/openchrome: Remove via_init_td_timing_regs()

Signed-off-by: Kevin Brace 

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 A-Bh */
-   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 
Date:   Fri Jan 21 16:38:01 2022 -0600

drm/openchrome: Remove via_init_crtc_regs()

Signed-off-by: Kevin Brace 

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-

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.17' - 14 commits - drivers/gpu/drm

2022-01-21 Thread Kevin Brace
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c   |   45 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c|   32 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  |5 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c |   20 +---
 drivers/gpu/drm/amd/amdgpu/cik.c |4 
 drivers/gpu/drm/amd/amdgpu/vi.c  |4 
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c |   11 --
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c|   11 --
 drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c |   25 --
 drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.h |2 
 drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c |   25 --
 drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.h |2 
 drivers/gpu/drm/amd/display/dc/irq/irq_service.c |2 
 drivers/gpu/drm/amd/display/dc/irq/irq_service.h |4 
 drivers/gpu/drm/i915/display/intel_ddi.c |   22 +
 drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c   |   10 +-
 drivers/gpu/drm/i915/i915_reg.h  |8 +
 drivers/gpu/drm/radeon/radeon_kms.c  |   22 ++---
 18 files changed, 108 insertions(+), 146 deletions(-)

New commits:
commit 1a8a0e9f160f0abffe65a29a7484d153e53bf467
Merge: 172d6fe5e9d7 ccf34586758c
Author: Kevin Brace 
Date:   Fri Jan 21 16:06:32 2022 -0600

Merge tag 'drm-next-2022-01-21' of git://anongit.freedesktop.org/drm/drm 
into drm-next-5.17

drm fixes for 5.17-rc1

amdgpu:
- SR-IOV fix
- VCN harvest fix
- Suspend/resume fixes
- Tahiti fix
- Enable GPU recovery on yellow carp

radeon:
- Fix error handling regression in radeon_driver_open_kms

i915:
- Update EHL display voltage swing table
- Fix programming the ADL-P display TC voltage swing

commit ccf34586758cf00c0934e48f6ef6d688f01d7b19
Merge: 410482b51afe 4722f463896c
Author: Dave Airlie 
Date:   Fri Jan 21 08:37:56 2022 +1000

Merge tag 'amd-drm-fixes-5.17-2022-01-19' of 
https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-fixes-5.17-2022-01-19:

amdgpu:
- SR-IOV fix
- VCN harvest fix
- Suspend/resume fixes
- Tahiti fix
- Enable GPU recovery on yellow carp

radeon:
- Fix error handling regression in radeon_driver_open_kms

Signed-off-by: Dave Airlie 
From: Alex Deucher 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20220120013547.5649-1-alexander.deuc...@amd.com

commit 410482b51afecddb8fc29324d1b11945dfa0b682
Merge: 4efdddbce7c1 e26602be4869
Author: Dave Airlie 
Date:   Fri Jan 21 08:31:29 2022 +1000

Merge tag 'drm-intel-next-fixes-2022-01-20' of 
git://anongit.freedesktop.org/drm/drm-intel into drm-next

- Latest updates for the EHL display voltage swing table (José Roberto de 
Souza)
- Additional step is required when programming the ADL-P display TC voltage 
swing (José Roberto de Souza)

Signed-off-by: Dave Airlie 
From: Tvrtko Ursulin 
Link: 
https://patchwork.freedesktop.org/patch/msgid/Yek1zdsnRPiBVvFF@tursulin-mobl2

commit 4722f463896cc0ef1a6f1c3cb2e171e949831249
Author: Christian König 
Date:   Mon Jan 17 10:31:26 2022 +0100

drm/radeon: fix error handling in radeon_driver_open_kms

The return value was never initialized so the cleanup code executed when
it isn't even necessary.

Just add proper error handling.

Fixes: ab50cb9df889 ("drm/radeon/radeon_kms: Fix a NULL pointer dereference 
in radeon_driver_open_kms()")
Signed-off-by: Christian König 
Tested-by: Jan Stancek 
Tested-by: Borislav Petkov 
Reviewed-by: Alex Deucher 
Signed-off-by: Alex Deucher 

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
b/drivers/gpu/drm/radeon/radeon_kms.c
index e2488559cc9f..11ad210919c8 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -666,18 +666,18 @@ int radeon_driver_open_kms(struct drm_device *dev, struct 
drm_file *file_priv)
fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
if (unlikely(!fpriv)) {
r = -ENOMEM;
-   goto out_suspend;
+   goto err_suspend;
}
 
if (rdev->accel_working) {
vm = >vm;
r = radeon_vm_init(rdev, vm);
if (r)
-   goto out_fpriv;
+   goto err_fpriv;
 
r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
if (r)
-   goto out_vm_fini;
+   goto err_vm_fini;
 
/* map the ib po

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.17' - 2 commits - drivers/gpu/drm

2022-01-14 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_drv.c |1 +
 drivers/gpu/drm/openchrome/openchrome_drv.h |4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 172d6fe5e9d79eeb4c7ba10236149a785e5f0359
Author: Kevin Brace 
Date:   Fri Jan 14 17:19:22 2022 -0600

drm/openchrome: Version bumped to 3.4.13

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index d1c5f72130b2..db75e013fe4f 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  12
+#define DRIVER_PATCHLEVEL  13
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220107"
+#define DRIVER_DATE"20220114"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 07bd8bab7f5a138dbbf2249b5bf1c1ab2ebd6a4f
Author: Kevin Brace 
Date:   Fri Jan 14 17:12:27 2022 -0600

drm/openchrome: Return -EINVAL if KMS is disabled

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c 
b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 8d16de74eae6..54d4c2d1efba 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -271,6 +271,7 @@ static int __init openchrome_init(void)
}
 
if (!openchrome_modeset) {
+   ret = -EINVAL;
goto exit;
}
 


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.17' - drivers/gpu/drm

2022-01-14 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_drv.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 18ad1ea1463f7ce507f879f68ce6c615ad7d5a36
Author: Kevin Brace 
Date:   Fri Jan 14 17:01:58 2022 -0600

drm: Move nomodeset kernel parameter to the DRM subsystem

Based on commit 6a2d2dd (drm: Move nomodeset kernel parameter to
the DRM subsystem).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c 
b/drivers/gpu/drm/openchrome/openchrome_drv.c
index fb9a6481a28e..8d16de74eae6 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -27,7 +27,6 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include 
 #include 
 
 #include 
@@ -267,7 +266,7 @@ static int __init openchrome_init(void)
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
if ((openchrome_modeset == -1) &&
-   (vgacon_text_force())) {
+   (drm_firmware_drivers_only())) {
openchrome_modeset = 0;
}
 


[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.17'

2022-01-07 Thread Kevin Brace
New branch 'drm-next-5.17' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.16' - 4 commits - drivers/gpu/drm

2022-01-07 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_display.c |  178 
 drivers/gpu/drm/openchrome/openchrome_drv.h |7 
 drivers/gpu/drm/openchrome/openchrome_hdmi.c|3 
 3 files changed, 2 insertions(+), 186 deletions(-)

New commits:
commit 8fa71d63b91c461812972df4b4f9cc36b8aab1fd
Author: Kevin Brace 
Date:   Fri Jan 7 18:53:40 2022 -0600

drm/openchrome: Version bumped to 3.4.12

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 99ad3c533c3d..d1c5f72130b2 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  11
+#define DRIVER_PATCHLEVEL  12
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20220104"
+#define DRIVER_DATE"20220107"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit d7e6857544e3c540a15a0ee8c0fe6d9c5be41b56
Author: Kevin Brace 
Date:   Fri Jan 7 18:49:58 2022 -0600

drm/openchrome: Remove via_encoder_prepare()

Only VX900 chipset integrated HDMI / DVI code uses it, and it does not
really do anything relevant for VX900 chipset integrated HDMI / DVI
code.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c 
b/drivers/gpu/drm/openchrome/openchrome_display.c
index 44db0fff1c78..8dd0725c3fda 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -72,12 +72,6 @@ via_set_sync_polarity(struct drm_encoder *encoder, struct 
drm_display_mode *mode
}
 }
 
-void
-via_encoder_prepare(struct drm_encoder *encoder)
-{
-   encoder->helper_private->dpms(encoder, DRM_MODE_DPMS_OFF);
-}
-
 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 c1a6e5cb5fa3..99ad3c533c3d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -457,7 +457,6 @@ extern 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);
-extern void via_encoder_prepare(struct drm_encoder *encoder);
 
 /* connectors */
 extern int via_connector_mode_valid(struct drm_connector *connector,
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c 
b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 958c716e566a..5332a564426c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -389,7 +389,6 @@ static const struct drm_encoder_helper_funcs 
via_hdmi_enc_helper_funcs = {
.dpms = via_hdmi_enc_dpms,
.mode_fixup = via_hdmi_enc_mode_fixup,
.mode_set = via_hdmi_enc_mode_set,
-   .prepare = via_encoder_prepare,
 };
 
 static unsigned int via_check_hdmi_i2c_status(
commit d3491a81091f66396d06dee28374178c348a5af2
Author: Kevin Brace 
Date:   Fri Jan 7 18:30:49 2022 -0600

drm/openchrome: Remove via_encoder_disable()

Only VX900 chipset integrated HDMI / DVI code uses it, and it does not
really do anything relevant for VX900 chipset integrated HDMI / DVI
code.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c 
b/drivers/gpu/drm/openchrome/openchrome_display.c
index c15c71f1f29a..44db0fff1c78 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -28,57 +28,6 @@
 
 #include "openchrome_drv.h"
 
-void
-via_encoder_disable(struct drm_encoder *encoder)
-{
-   struct via_encoder *enc = container_of(encoder, struct via_encoder, 
base);
-   struct openchrome_drm_private *dev_private =
-   encoder->dev->dev_private;
-
-   /* First turn off the display */
-   encoder->helper_private->dpms(encoder, DRM_MODE_DPMS_OFF);
-
-   switch (enc->di_port) {
-   case VIA_DI_PORT_DVP0:
-   svga_wseq_mask(VGABASE, 0x1E, 0x00, BIT(7) | BIT(6));
-   break;
-
-   case VIA_DI_PORT_DVP1:
-   svga_wseq_mask(VGABASE, 0x1E, 0x00, BIT(5) | BIT(4));
-   break;
-
-   case VIA_DI_PORT_DFPH:
-   svga_wseq_mask(VGABASE, 0x2A, 0x00, BIT(3) | BIT(2));
-   break;
-
-   case VIA_DI_PORT_DFPL:
-   svga_wseq_mask(VGABASE, 0x

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.16' - drivers/gpu/drm

2022-01-07 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_ttm.c |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 3ba1c2cf0eaae47c36ceb22648441822c2fc081e
Author: Kevin Brace 
Date:   Fri Jan 7 17:30:38 2022 -0600

drm/ttm: remove ttm_tt_destroy_common v2

Based on commit d5f45d1 (drm/ttm: remove ttm_tt_destroy_common v2).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_ttm.c 
b/drivers/gpu/drm/openchrome/openchrome_ttm.c
index 004244530b6e..678e0e017cbe 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ttm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ttm.c
@@ -78,7 +78,6 @@ err_ttm_tt_init:
 static void openchrome_ttm_tt_destroy(struct ttm_device *bdev,
struct ttm_tt *tt)
 {
-   ttm_tt_destroy_common(bdev, tt);
ttm_tt_fini(tt);
kfree(tt);
 }


[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.16'

2022-01-04 Thread Kevin Brace
New branch 'drm-next-5.16' available with the following commits:


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.15' - 4 commits - drivers/gpu/drm

2022-01-04 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_analog.c  |1 -
 drivers/gpu/drm/openchrome/openchrome_crtc.c|3 +++
 drivers/gpu/drm/openchrome/openchrome_cursor.c  |1 +
 drivers/gpu/drm/openchrome/openchrome_display.c |   14 --
 drivers/gpu/drm/openchrome/openchrome_drv.c |3 +++
 drivers/gpu/drm/openchrome/openchrome_drv.h |8 ++--
 drivers/gpu/drm/openchrome/openchrome_fb.c  |4 +++-
 drivers/gpu/drm/openchrome/openchrome_ioctl.c   |3 +++
 drivers/gpu/drm/openchrome/openchrome_object.c  |1 +
 drivers/gpu/drm/openchrome/openchrome_sii164.c  |1 -
 drivers/gpu/drm/openchrome/openchrome_tmds.c|1 -
 drivers/gpu/drm/openchrome/openchrome_vt1632.c  |1 -
 12 files changed, 16 insertions(+), 25 deletions(-)

New commits:
commit 9f86246847f0ec8caac3303c3a788d72e16984e6
Author: Kevin Brace 
Date:   Tue Jan 4 16:34:07 2022 -0600

drm/openchrome: Version bumped to 3.4.11

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index c7b05ea70c0f..3427e05cc59a 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  10
+#define DRIVER_PATCHLEVEL  11
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20211227"
+#define DRIVER_DATE"20220104"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 96bbfd03a455ae75079155de7dbe24d809708598
Author: Kevin Brace 
Date:   Tue Jan 4 15:49:25 2022 -0600

drm/openchrome: Add drm/ when including drm_gem_framebuffer_helper.h

Commit edd6b31 (drm/openchrome: Use GEM framebuffer helpers for
drm_framebuffer_funcs) missed "drm/" in front of the header file.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_fb.c 
b/drivers/gpu/drm/openchrome/openchrome_fb.c
index 83c4b9332d8e..b6ebd2440ea3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fb.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fb.c
@@ -29,7 +29,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
commit 440eb47343f0f4b7bffda6f3b57c92de8f4bb3de
Author: Kevin Brace 
Date:   Tue Jan 4 15:48:57 2022 -0600

drm/openchrome: Include drm_gem.h and ttm_bo_api.h where appropriate

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index b65e72d0414c..8047be5b92d2 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -39,12 +39,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+
 #include "openchrome_drv.h"
 #include "openchrome_disp_reg.h"
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c 
b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index dc662fa02fb1..058f935a517a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c 
b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 6c30a521b688..fb9a6481a28e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -33,8 +33,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
+#include 
+
 #include "openchrome_drv.h"
 
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 5bbacb3badb7..c7b05ea70c0f 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -45,7 +45,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_fb.c 
b/drivers/gpu/drm/openchrome/openchrome_fb.c
index b1bba29d406c..83c4b9332d8e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fb.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fb.c
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+#include 
+
 #include "openchrome_drv.h"
 
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_ioctl.c 
b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
index 22109188c869..bf56513565c9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_ioctl.c
+++ b/drivers/gpu/drm/openchrome/openchrome_ioctl.c
@@ -28,8 +28,11 @@
  * Kevin Brace 
  */
 
+#include 
 #include 
 
+#include 
+
 #include "openchrome_drv.h"
 
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_object.c 
b/drivers/gpu/drm/openchrome/openchrome_object.c
index db45e38f4

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.14' - 10 commits - drivers/gpu/drm

2021-12-30 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_crtc.c   |   43 ++---
 drivers/gpu/drm/openchrome/openchrome_cursor.c |   23 -
 drivers/gpu/drm/openchrome/openchrome_drv.c|8 ++--
 drivers/gpu/drm/openchrome/openchrome_drv.h|5 +-
 drivers/gpu/drm/openchrome/openchrome_fb.c |2 -
 drivers/gpu/drm/openchrome/openchrome_fp.c |8 
 drivers/gpu/drm/openchrome/openchrome_ioctl.c  |8 ++--
 drivers/gpu/drm/openchrome/openchrome_object.c |   18 ++
 8 files changed, 70 insertions(+), 45 deletions(-)

New commits:
commit 1f2d71cc3367aa721936b40bb7182ab9756a1d09
Author: Kevin Brace 
Date:   Mon Dec 27 16:37:24 2021 -0600

drm/openchrome: Version bumped to 3.4.10

This version fixes FP (Flat Panel) support code regression when the
mode setting code was converted to support atomic mode setting.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index beac0c1fbd77..d501dfb8e1e3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,10 +61,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   4
-#define DRIVER_PATCHLEVEL  9
+#define DRIVER_PATCHLEVEL  10
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20210521"
+#define DRIVER_DATE"20211227"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit 0d6ae650b0feb2fcfa19788e1e9b572026a8486d
Author: Kevin Brace 
Date:   Mon Dec 27 16:37:07 2021 -0600

drm/openchrome: Fix for sporadic cursor disable code crash

What happens is that openchrome_cursor_atomic_disable() is occassionally
handed a null pointer for its crtc parameter.  Just check for a null
pointer before disabling the display of the cursor.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c 
b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index b9a685488c97..dc662fa02fb1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -49,9 +49,9 @@
 #include "openchrome_drv.h"
 
 
-static void openchrome_hide_cursor(struct drm_device *dev,
-   struct drm_crtc *crtc)
+static void openchrome_hide_cursor(struct drm_crtc *crtc)
 {
+   struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -396,12 +396,13 @@ void openchrome_cursor_atomic_disable(struct drm_plane 
*plane,
 {
struct drm_plane_state *new_state =
drm_atomic_get_new_plane_state(state, plane);
-   struct drm_device *dev = plane->dev;
struct drm_crtc *crtc = new_state->crtc;
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   openchrome_hide_cursor(dev, crtc);
+   if (crtc) {
+   openchrome_hide_cursor(crtc);
+   }
 
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
commit 3bef18990ed2769442be8e501262330f83d9c0a6
Author: Kevin Brace 
Date:   Mon Dec 27 16:36:53 2021 -0600

drm/openchrome: Dual head fix for atomic mode setting

Simultaneous display needs to be disabled for dual head (IGA1 and IGA2)
mode to function properly.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 509828254bf3..b65e72d0414c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -79,6 +79,17 @@ static void via_iga_common_init(void __iomem *regs)
 *   1: Enable */
svga_wseq_mask(regs, 0x15, BIT(5) | BIT(1), BIT(5) | BIT(1));
 
+   /*
+* Disable simultaneous display.
+* Turning this on causes IGA1 to have a display issue.
+*/
+   /*
+* 3X5.6B[3]   - Simultaneous Display Enable
+*   0: Disable
+*   1: Enable
+*/
+   svga_wcrt_mask(regs, 0x6B, 0x00, BIT(3));
+
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
commit dbf5833e08f3d63d0a3b23b4a3011766b1fc6514
Author: Kevin Brace 
Date:   Mon Dec 27 16:36:29 2021 -0600

    drm/openchrome: Rearrange openchrome_mode_set_nofb() declarations

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index a14205a3b41c..509828254bf3 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1578,15 +1578,15 @@ via_set_iga2_downscale_source_timing(stru

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 3 commits - configure.ac src/via_fp.c src/via_output.c src/via_sii164.c src/via_ums.h src/via_vt1632.c

2021-07-25 Thread Kevin Brace
 configure.ac |2 -
 src/via_fp.c |8 +
 src/via_output.c |   42 +
 src/via_sii164.c |   15 ++
 src/via_ums.h|   78 +++
 src/via_vt1632.c |   15 ++
 6 files changed, 159 insertions(+), 1 deletion(-)

New commits:
commit 15c868a8150aa0bebabf8f9face77568adc161c1
Author: Kevin Brace 
Date:   Sun Jul 25 19:52:23 2021 -0500

Version bumped to 0.6.409

Added the necessary code for CLE266 chipset to support an external
DVI transmitter.  Both Silicon Image SiI 164 and VIA Technologies
VT1632(A) have the relevant code.  The code was tested on NeoWare
CA10 model with DVI.  It should work on VIA Embedded EPIA-M with
DVI-01 module, but it was not confirmed (do not have the DVI-01
module).  While the code was not tested with an LCD panel, some of
the added new code improves the CLE266 chipset's LCD panel support.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 9119300..e6888e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.408],
+[0.6.409],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit 7b385b3caff3848d1fccc524887624868a74ef59
Author: Kevin Brace 
Date:   Sun Jul 25 19:49:34 2021 -0500

Add viaClockSource() to specify CLE266 chipset's DIPx clock source

Signed-off-by: Kevin Brace 

diff --git a/src/via_output.c b/src/via_output.c
index 9528c3b..3711b21 100644
--- a/src/via_output.c
+++ b/src/via_output.c
@@ -110,6 +110,27 @@ viaOutputEnable(ScrnInfoPtr pScrn, uint32_t diPort, Bool 
outputEnable)
 "Exiting %s.\n", __func__));
 }
 
+void
+viaClockSource(ScrnInfoPtr pScrn, uint32_t diPort, Bool clockSource)
+{
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Entered %s.\n", __func__));
+
+switch(diPort) {
+case VIA_DI_PORT_DIP0:
+viaDIP0SetClockSource(pScrn, clockSource);
+break;
+case VIA_DI_PORT_DIP1:
+viaDIP1SetClockSource(pScrn, clockSource);
+break;
+default:
+break;
+}
+
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Exiting %s.\n", __func__));
+}
+
 void
 viaDisplaySource(ScrnInfoPtr pScrn, uint32_t diPort, int index)
 {
diff --git a/src/via_sii164.c b/src/via_sii164.c
index f5501f6..3a07085 100644
--- a/src/via_sii164.c
+++ b/src/via_sii164.c
@@ -295,6 +295,7 @@ via_sii164_mode_set(xf86OutputPtr output, DisplayModePtr 
mode,
 {
 ScrnInfoPtr pScrn = output->scrn;
 drmmode_crtc_private_ptr iga = output->crtc->driver_private;
+VIAPtr pVia = VIAPTR(pScrn);
 viaSiI164RecPtr pSiI164Rec = output->driver_private;
 
 DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -305,6 +306,10 @@ via_sii164_mode_set(xf86OutputPtr output, DisplayModePtr 
mode,
 viaExtTMDSSetDataDriveStrength(pScrn, 0x03);
 viaIOPadState(pScrn, pSiI164Rec->diPort, 0x03);
 
+if (pVia->Chipset == VIA_CLE266) {
+viaClockSource(pScrn, pSiI164Rec->diPort, TRUE);
+}
+
 viaSiI164DumpRegisters(pScrn, pSiI164Rec->pSiI164I2CDev);
 viaSiI164InitRegisters(pScrn, pSiI164Rec->pSiI164I2CDev);
 viaSiI164DumpRegisters(pScrn, pSiI164Rec->pSiI164I2CDev);
diff --git a/src/via_ums.h b/src/via_ums.h
index d406d53..1d37581 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -519,6 +519,25 @@ viaDIP0SetOutputEnable(ScrnInfoPtr pScrn, Bool 
outputEnable)
 outputEnable ? "Enable" : "Disable"));
 }
 
+/*
+ * Sets the clock source of DIP0 (Digital Interface Port 0)
+ * interface. CLE266 chipset only.
+ */
+static inline void
+viaDIP0SetClockSource(ScrnInfoPtr pScrn, Bool clockSource)
+{
+/*
+ * 3X5.6C[5] - DIP0 Clock Source
+ * 0: External
+ * 1: Internal
+ */
+ViaCrtcMask(VGAHWPTR(pScrn), 0x6C,
+clockSource ? BIT(5) : 0x00, BIT(5));
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"DIP0 Clock Source: %s\n",
+clockSource ? "Internal" : "External"));
+}
+
 /*
  * Sets the display source of DIP0 (Digital Interface Port 0)
  * interface. CLE266 chipset only.
@@ -580,6 +599,25 @@ viaDIP1SetOutputEnable(ScrnInfoPtr pScrn, Bool 
outputEnable)
 outputEnable ? "Enable" : "Disable"));
 }
 
+/*
+ * Sets the clock source of DIP1 (Digital Interface Port 1)
+ * interface. CLE266 chipset only.
+ */
+static inline void
+viaDIP1SetClockSource(ScrnInfoPtr pScrn, Bool clockSource)
+{
+/*
+ * 3X5.93[5] - DIP1 Clock Source
+ * 0: External
+ * 1: Internal

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 5 commits - src/via_display.c src/via_fp.c src/via_output.c src/via_tmds.c src/via_ums.h

2021-07-25 Thread Kevin Brace
 src/via_display.c |   16 
 src/via_fp.c  |9 +++--
 src/via_output.c  |   12 
 src/via_tmds.c|   22 --
 src/via_ums.h |   44 
 5 files changed, 91 insertions(+), 12 deletions(-)

New commits:
commit 6784fa3cc88fd67369edb4bf9662a74d0e837ce5
Author: Kevin Brace 
Date:   Sun Jul 25 17:29:01 2021 -0500

Fix for screen distortion when CLE266 chipset's IGA2 is being used

Not resetting CR55[7] to 0 causes screen distortion on CLE266 chipset's
screen driven by IGA2.

Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index 460cf1f..3ef093e 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -697,6 +697,13 @@ viaIGAInitCommon(ScrnInfoPtr pScrn)
 temp = hwp->readCrtc(hwp, 0x47);
 DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 "CR47: 0x%02X\n", temp));
+
+if (pVia->Chipset == VIA_CLE266) {
+temp = hwp->readCrtc(hwp, 0x55);
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"CR55: 0x%02X\n", temp));
+}
+
 temp = hwp->readCrtc(hwp, 0x6B);
 DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 "CR6B: 0x%02X\n", temp));
@@ -916,6 +923,15 @@ viaIGAInitCommon(ScrnInfoPtr pScrn)
  * Clock Select and CRTC Register Protect */
 ViaCrtcMask(hwp, 0x47, 0x00, 0x23);
 
+/*
+ * It was observed on NeoWare CA10 thin client with DVI that not
+ * resetting CR55[7] to 0 causes the screen driven by IGA2 to get
+ * distorted.
+ */
+if (pVia->Chipset == VIA_CLE266) {
+ViaCrtcMask(hwp, 0x55, 0x00, BIT(7));
+}
+
 /* 3X5.6B[3] - Simultaneous Display Enable
  * 0: Disable
  * 1: Enable */
commit 4950b674fed875b5256d9d754f1ee7a4bfb3cd13
Author: Kevin Brace 
Date:   Sun Jul 25 17:27:06 2021 -0500

Add display source and I/O pad control support for CLE266 chipset's DIP1

Signed-off-by: Kevin Brace 

diff --git a/src/via_output.c b/src/via_output.c
index dedbe45..7e4b7c1 100644
--- a/src/via_output.c
+++ b/src/via_output.c
@@ -50,6 +50,9 @@ viaIOPadState(ScrnInfoPtr pScrn, uint32_t diPort, uint8_t 
ioPadState)
 case VIA_DI_PORT_DIP0:
 viaDIP0SetIOPadState(pScrn, ioPadState);
 break;
+case VIA_DI_PORT_DIP1:
+viaDIP1SetIOPadState(pScrn, ioPadState);
+break;
 case VIA_DI_PORT_DVP0:
 viaDVP0SetIOPadState(pScrn, ioPadState);
 break;
@@ -98,6 +101,9 @@ viaDisplaySource(ScrnInfoPtr pScrn, uint32_t diPort, int 
index)
 case VIA_DI_PORT_DIP0:
 viaDIP0SetDisplaySource(pScrn, displaySource);
 break;
+case VIA_DI_PORT_DIP1:
+viaDIP1SetDisplaySource(pScrn, displaySource);
+break;
 case VIA_DI_PORT_DVP0:
 viaDVP0SetDisplaySource(pScrn, displaySource);
 break;
diff --git a/src/via_ums.h b/src/via_ums.h
index 902079f..c8abf69 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -517,6 +517,50 @@ viaDIP0SetDisplaySource(ScrnInfoPtr pScrn, CARD8 
displaySource)
 (displaySource & 0x01) + 1));
 }
 
+/*
+ * Sets DIP1 (Digital Interface Port 1) I/O pad state.
+ * CLE266 chipset only.
+ */
+static inline void
+viaDIP1SetIOPadState(ScrnInfoPtr pScrn, CARD8 ioPadState)
+{
+/*
+ * 3C5.1E[5:4] - DIP1 I/O Pad Control
+ *   00: I/O pad off
+ *   11: I/O pad on
+ */
+ViaSeqMask(VGAHWPTR(pScrn), 0x1E,
+ioPadState << 4, BIT(5) | BIT(4));
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"DIP1 I/O Pad State: %s\n",
+((ioPadState & (BIT(1) | BIT(0))) == 0x03) ?
+"On" :
+((ioPadState & (BIT(1) | BIT(0))) == 0x02) ?
+"Unknown" :
+((ioPadState & (BIT(1) | BIT(0))) == 0x01) ?
+"Unknown" :
+"Off"));
+}
+
+/*
+ * Sets the display source of DIP1 (Digital Interface Port 1)
+ * interface. CLE266 chipset only.
+ */
+static inline void
+viaDIP1SetDisplaySource(ScrnInfoPtr pScrn, uint8_t displaySource)
+{
+/*
+ * 3X5.93[7] - DIP1 Data Source Selection
+ * 0: IGA1
+ * 1: IGA2
+ */
+ViaCrtcMask(VGAHWPTR(pScrn), 0x93,
+displaySource << 7, BIT(7));
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"DIP1 Display Source: IGA%d\n",
+(displaySource & 0x01) + 1));
+}
+
 
 /*
  * Sets DVP0 (Digital Video Port 0) I/O pad state.
commit 2030c80474c78a72c3b1487ad11d362e180b614d
Author: Kevin Brace 
Date:   Sun Jul 25 17:26:57 2021 -0500

Add display source and I/O pad

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 4 commits - configure.ac src/Makefile.am src/via_fp.c src/via_output.c src/via_outputs.c src/via_sii164.c src/via_tmds.c src/via_ums.h src/via

2021-07-25 Thread Kevin Brace
 configure.ac |2 
 src/Makefile.am  |2 
 src/via_fp.c |  107 ---
 src/via_output.c |   90 
 src/via_sii164.c |   12 -
 src/via_tmds.c   |  390 +--
 src/via_ums.h|6 
 src/via_vt1632.c |   12 -
 8 files changed, 120 insertions(+), 501 deletions(-)

New commits:
commit 104bad551eb98e7112b7f3251c0bdc31186ac286
Author: Kevin Brace 
Date:   Sun Jul 25 16:59:07 2021 -0500

Version bumped to 0.6.408

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 8844cfa..9119300 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.407],
+[0.6.408],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit bc7045a4a14c38dea0f6309d226710303b420ef7
Author: Kevin Brace 
Date:   Sun Jul 25 16:57:27 2021 -0500

Use viaDisplaySource() for FP and DVI display source selection

Signed-off-by: Kevin Brace 

diff --git a/src/via_fp.c b/src/via_fp.c
index 2501b76..497c82d 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -542,56 +542,6 @@ viaFPSyncPolarity(ScrnInfoPtr pScrn, uint32_t diPort, 
unsigned int flags)
 "Exiting viaFPSyncPolarity.\n"));
 }
 
-static void
-viaFPDisplaySource(ScrnInfoPtr pScrn, uint32_t diPort, int index)
-{
-CARD8 displaySource = index & 0x01;
-
-DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"Entered viaFPDisplaySource.\n"));
-
-switch(diPort) {
-case VIA_DI_PORT_DVP0:
-viaDVP0SetDisplaySource(pScrn, displaySource);
-break;
-case VIA_DI_PORT_DVP1:
-viaDVP1SetDisplaySource(pScrn, displaySource);
-break;
-case VIA_DI_PORT_FPDPLOW:
-viaFPDPLowSetDisplaySource(pScrn, displaySource);
-viaDVP1SetDisplaySource(pScrn, displaySource);
-break;
-case VIA_DI_PORT_FPDPHIGH:
-viaFPDPHighSetDisplaySource(pScrn, displaySource);
-viaDVP0SetDisplaySource(pScrn, displaySource);
-break;
-case (VIA_DI_PORT_FPDPLOW |
-  VIA_DI_PORT_FPDPHIGH):
-viaFPDPLowSetDisplaySource(pScrn, displaySource);
-viaFPDPHighSetDisplaySource(pScrn, displaySource);
-break;
-case VIA_DI_PORT_LVDS1:
-viaLVDS1SetDisplaySource(pScrn, displaySource);
-break;
-case VIA_DI_PORT_LVDS2:
-viaLVDS2SetDisplaySource(pScrn, displaySource);
-break;
-case (VIA_DI_PORT_LVDS1 |
-  VIA_DI_PORT_LVDS2):
-viaLVDS1SetDisplaySource(pScrn, displaySource);
-viaLVDS2SetDisplaySource(pScrn, displaySource);
-break;
-default:
-break;
-}
-xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"FP Display Source: IGA%d\n",
-displaySource + 1);
-
-DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"Exiting viaFPDisplaySource.\n"));
-}
-
 /*
  * Try to interpret EDID ourselves.
  */
@@ -1063,7 +1013,7 @@ via_fp_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 }
 
 viaFPSyncPolarity(pScrn, pVIAFP->diPort, adjusted_mode->Flags);
-viaFPDisplaySource(pScrn, pVIAFP->diPort, iga->index);
+viaDisplaySource(pScrn, pVIAFP->diPort, iga->index);
 }
 }
 
diff --git a/src/via_output.c b/src/via_output.c
index e2c1452..2f20634 100644
--- a/src/via_output.c
+++ b/src/via_output.c
@@ -83,6 +83,53 @@ viaIOPadState(ScrnInfoPtr pScrn, uint32_t diPort, uint8_t 
ioPadState)
 "Exiting %s.\n", __func__));
 }
 
+void
+viaDisplaySource(ScrnInfoPtr pScrn, uint32_t diPort, int index)
+{
+CARD8 displaySource = index & 0x01;
+
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Entered %s.\n", __func__));
+
+switch(diPort) {
+case VIA_DI_PORT_DVP0:
+viaDVP0SetDisplaySource(pScrn, displaySource);
+break;
+case VIA_DI_PORT_DVP1:
+viaDVP1SetDisplaySource(pScrn, displaySource);
+break;
+case VIA_DI_PORT_FPDPLOW:
+viaFPDPLowSetDisplaySource(pScrn, displaySource);
+viaDVP1SetDisplaySource(pScrn, displaySource);
+break;
+case VIA_DI_PORT_FPDPHIGH:
+viaFPDPHighSetDisplaySource(pScrn, displaySource);
+viaDVP0SetDisplaySource(pScrn, displaySource);
+break;
+case (VIA_DI_PORT_FPDPLOW |
+  VIA_DI_PORT_FPDPHIGH):
+viaFPDPLowSetDisplaySource(pScrn, displaySource);
+viaFPDPHighSetDisplaySource(pScrn, displaySource);
+break;
+case VIA_DI_PORT_LVDS1:
+viaLVDS1SetDisplaySource(pScrn, displaySource);
+break;
+case VIA_DI_PORT_LVDS2:
+viaLVDS2SetDisplaySource(pScrn, displaySource);
+break;
+case (VIA_DI_PORT_LVDS1 |
+  VIA_DI_PORT_

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_fp.c

2021-07-14 Thread Kevin Brace
 configure.ac |2 +-
 src/via_fp.c |   22 +++---
 2 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit 88a200623ab74fb4f844ee6f4dd028f759465046
Author: Kevin Brace 
Date:   Wed Jul 14 21:42:14 2021 -0500

Version bumped to 0.6.407

Updated (reverted) FP (Flat Panel) table for models that do not have
I2C bus support for the FP or DDX is not able to obtain EDID from
the FP.  This might improve the FP support situation with European
market HP 2133 mini-note's 1024 x 600 FP made by LG Display (LGD).

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 203d49a..8844cfa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.406],
+[0.6.407],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit ea8eff1fde1465ac86c31c59df06cb5d89db0e11
Author: Kevin Brace 
Date:   Wed Jul 14 21:23:48 2021 -0500

Partial revert of FP table update

This sort of reverts commit d90a71c (Updated VIA Technologies
defined flat panel screen resolution table).  Hopefully, this
eliminates FP (Flat Panel) screen resolution issue observed with
European market HP 2133 mini-note 1024 x 600 FP made by LG Display
(LGD).

Signed-off-by: Kevin Brace 

diff --git a/src/via_fp.c b/src/via_fp.c
index 91ef73d..cfd19ae 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -47,24 +47,16 @@ static ViaPanelModeRec ViaPanelNativeModes[] = {
 {1280,  768, FALSE,  TRUE},
 {1280, 1024,  TRUE,  TRUE},
 {1400, 1050,  TRUE,  TRUE},
-{1600, 1200,  TRUE,  TRUE},
+{1440,  900,  TRUE,  TRUE},
 {1280,  800, FALSE,  TRUE},
 { 800,  480, FALSE,  TRUE},
-{1024,  768,  TRUE,  TRUE},
+{1024,  600,  TRUE,  TRUE},
 {1366,  768, FALSE, FALSE},
-{1024,  768,  TRUE, FALSE},
-{1280,  768, FALSE, FALSE},
-{1280, 1024,  TRUE, FALSE},
-{1400, 1050,  TRUE, FALSE},
-{1600, 1200,  TRUE, FALSE},
-{1366,  768, FALSE, FALSE},
-{1024,  600, FALSE,  TRUE},
-{1280,  768,  TRUE,  TRUE},
-{1280,  800, FALSE,  TRUE},
-{1360,  768, FALSE, FALSE},
-{1280,  768,  TRUE, FALSE},
-{ 480,  640, FALSE,  TRUE},
-{1200,  900, FALSE, FALSE}};
+{1680, 1050,  TRUE, FALSE},
+{1920, 1200, FALSE, FALSE},
+{ 640,  240,  TRUE, FALSE},
+{ 480,  640,  TRUE, FALSE}
+};
 
 #define MODEPREFIX(name) NULL, NULL, name, 0, M_T_DRIVER | M_T_DEFAULT
 #define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_display.c

2021-07-14 Thread Kevin Brace
 configure.ac  |2 +-
 src/via_display.c |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 01b0df191d2c7e370f0e4c0484200269d03c72f0
Author: Kevin Brace 
Date:   Wed Jul 14 21:22:26 2021 -0500

Version bumped to 0.6.406

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index b85e64d..203d49a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.405],
+[0.6.406],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit b8d8773a852f8dfb17a95dc0a76a3335747c8309
Author: Kevin Brace 
Date:   Wed Jul 14 21:20:21 2021 -0500

Eliminate unnecessary zero clear of HI buffer

By not zero clearing HI (Hardware Icon) buffer, this commit
improves performance slightly.

Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index 66d6142..460cf1f 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3496,7 +3496,6 @@ via_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 void *dst;
 
 dst = drm_bo_map(pScrn, iga->cursor_bo);
-memset(dst, 0x00, iga->cursor_bo->size);
 memcpy(dst, image, iga->cursor_bo->size);
 drm_bo_unmap(pScrn, iga->cursor_bo);
 
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


[openchrome-devel] xf86-video-openchrome: Branch 'main' - src/via_display.c src/via_driver.c src/via_driver.h

2021-07-14 Thread Kevin Brace
 src/via_display.c |  140 --
 src/via_driver.c  |   10 ---
 src/via_driver.h  |2 
 3 files changed, 14 insertions(+), 138 deletions(-)

New commits:
commit 0f5de30afc448aa6b0c231d1104f3fc4baeb307c
Author: Kevin Brace 
Date:   Wed Jul 14 19:59:31 2021 -0500

Revert "Activate hardware cursor for CLE266 and KM400 chipsets"

This reverts commit 9dec320b2868a42765bc9467970b8372a3fd2897.

diff --git a/src/via_display.c b/src/via_display.c
index ae4fb54..66d6142 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -175,83 +175,6 @@ viaIGA1SetGamma(ScrnInfoPtr pScrn, CARD8 gammaCorrection)
 "Exiting viaIGA1SetGamma.\n"));
 }
 
-/*
- * This function displays or hides hardware cursor (HC).
- */
-static void
-viaSelectIGAHC(ScrnInfoPtr pScrn, Bool igaSelect)
-{
-VIAPtr pVia = VIAPTR(pScrn);
-uint32_t temp;
-
-temp = VIAGETREG(VIA_REG_CURSOR_MODE);
-temp &= 0x7FFF;
-temp |= igaSelect ? 0x8000 : 0x;
-
-/* VIA_REG_CURSOR_MODE[31] - Hardware cursor display path */
-VIASETREG(VIA_REG_CURSOR_MODE, temp);
-}
-
-/*
- * This function displays or hides hardware cursor (HC).
- */
-static void
-viaDisplayHC(ScrnInfoPtr pScrn, Bool hcStatus)
-{
-VIAPtr pVia = VIAPTR(pScrn);
-uint32_t temp;
-
-temp = VIAGETREG(VIA_REG_CURSOR_MODE);
-temp &= 0xFFFE;
-temp |= hcStatus ? 0x0001 : 0x;
-
-/* VIA_REG_CURSOR_MODE[0] - Hardware Cursor Enable */
-VIASETREG(VIA_REG_CURSOR_MODE, temp);
-}
-
-static void
-viaSetHCStartingAddress(xf86CrtcPtr crtc)
-{
-drmmode_crtc_private_ptr iga = crtc->driver_private;
-ScrnInfoPtr pScrn = crtc->scrn;
-VIAPtr pVia = VIAPTR(pScrn);
-uint32_t temp;
-
-temp = VIAGETREG(VIA_REG_CURSOR_MODE);
-temp &= 0xFCFF;
-temp |= iga->cursor_bo->offset;
-
-/*
- * 64x64 hardware cursor
- */
-temp &= 0xFFFD;
-
-/*
- * VIA_REG_CURSOR_MODE[25:8] - Hardware Cursor Base Address
- */
-VIASETREG(VIA_REG_CURSOR_MODE, temp);
-}
-
-static void
-viaSetHCLocation(ScrnInfoPtr pScrn,
-int x, unsigned int xoff,
-int y, unsigned int yoff)
-{
-VIAPtr pVia = VIAPTR(pScrn);
-
-VIASETREG(VIA_REG_CURSOR_POS, ((x<< 16) | (y& 0x07ff)));
-VIASETREG(VIA_REG_CURSOR_ORG, ((xoff << 16) | (yoff & 0x07ff)));
-}
-
-static void
-viaSetHCColor(ScrnInfoPtr pScrn, int bg, int fg)
-{
-VIAPtr pVia = VIAPTR(pScrn);
-
-VIASETREG(VIA_REG_CURSOR_BG, bg);
-VIASETREG(VIA_REG_CURSOR_FG, fg);
-}
-
 static void
 viaIGA1InitHI(ScrnInfoPtr pScrn)
 {
@@ -3489,7 +3412,6 @@ via_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int 
fg)
 ScrnInfoPtr pScrn = crtc->scrn;
 drmmode_crtc_private_ptr iga = crtc->driver_private;
 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-VIAPtr pVia = VIAPTR(pScrn);
 
 if (xf86_config->cursor_fg)
 return;
@@ -3502,14 +3424,10 @@ via_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, 
int fg)
 return;
 }
 
-if (pVia->useHardwareCursor) {
-viaSetHCColor(pScrn, bg, fg);
+if (!iga->index) {
+viaIGA1DisplayHI(pScrn, FALSE);
 } else {
-if (!iga->index) {
-viaIGA1DisplayHI(pScrn, FALSE);
-} else {
-viaIGA2DisplayHI(pScrn, FALSE);
-}
+viaIGA2DisplayHI(pScrn, FALSE);
 }
 
 xf86_config->cursor_fg = fg;
@@ -3521,7 +3439,6 @@ via_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int 
y)
 {
 ScrnInfoPtr pScrn = crtc->scrn;
 drmmode_crtc_private_ptr iga = crtc->driver_private;
-VIAPtr pVia = VIAPTR(pScrn);
 unsigned xoff, yoff;
 
 if (x < 0) {
@@ -3538,14 +3455,10 @@ via_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, 
int y)
 yoff = 0;
 }
 
-if (pVia->useHardwareCursor) {
-viaSetHCLocation(pScrn, x, xoff, y, yoff);
+if (!iga->index) {
+viaIGA1SetHIDisplayLocation(pScrn, x, xoff, y, yoff);
 } else {
-if (!iga->index) {
-viaIGA1SetHIDisplayLocation(pScrn, x, xoff, y, yoff);
-} else {
-viaIGA2SetHIDisplayLocation(pScrn, x, xoff, y, yoff);
-}
+viaIGA2SetHIDisplayLocation(pScrn, x, xoff, y, yoff);
 }
 }
 
@@ -3554,18 +3467,11 @@ via_crtc_show_cursor(xf86CrtcPtr crtc)
 {
 ScrnInfoPtr pScrn = crtc->scrn;
 drmmode_crtc_private_ptr iga = crtc->driver_private;
-VIAPtr pVia = VIAPTR(pScrn);
 
-if (pVia->useHardwareCursor) {
-viaSelectIGAHC(pScrn,
-iga->index ? TRUE : FALSE);
-viaDisplayHC(pScrn, TRUE);
+if (!iga->index) {
+viaIGA1DisplayHI(pScrn, TRUE);
 } else {
-if (!iga->index) {
-viaIGA1DisplayHI(pScrn, TRUE);
-} else {
-viaIGA2DisplayHI(pScrn, TRUE);

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/via_display.c src/via_driver.c src/via_driver.h

2021-07-14 Thread Kevin Brace
 configure.ac  |2 
 src/via_display.c |  140 +-
 src/via_driver.c  |   10 +++
 src/via_driver.h  |2 
 4 files changed, 139 insertions(+), 15 deletions(-)

New commits:
commit b33b9b20d0e043c6bec2074181f75d3ff585b6ce
Author: Kevin Brace 
Date:   Wed Jul 14 17:54:09 2021 -0500

Version bumped to 0.6.405

Use bi-color hardware cursor on CLE266 and KM400 chipsets.  Note
that due to hardware limitation, only one CRTC (IGA1 or IGA2) can
display the cursor.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index f2f4086..b85e64d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.404],
+[0.6.405],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit 9dec320b2868a42765bc9467970b8372a3fd2897
Author: Kevin Brace 
Date:   Wed Jul 14 17:37:47 2021 -0500

Activate hardware cursor for CLE266 and KM400 chipsets

Unfortunately, the current HI (Hardware Icon) based overlay cursor
code does not work properly on CLE266 and KM400 chipsets.  Instead,
use bi-color hardware cursor on these platforms.  The limitation
of the code is that it can only display the hardware cursor on one
CRTC (IGA1 or IGA2).  This is due to hardware limitation.

Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index 66d6142..ae4fb54 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -175,6 +175,83 @@ viaIGA1SetGamma(ScrnInfoPtr pScrn, CARD8 gammaCorrection)
 "Exiting viaIGA1SetGamma.\n"));
 }
 
+/*
+ * This function displays or hides hardware cursor (HC).
+ */
+static void
+viaSelectIGAHC(ScrnInfoPtr pScrn, Bool igaSelect)
+{
+VIAPtr pVia = VIAPTR(pScrn);
+uint32_t temp;
+
+temp = VIAGETREG(VIA_REG_CURSOR_MODE);
+temp &= 0x7FFF;
+temp |= igaSelect ? 0x8000 : 0x;
+
+/* VIA_REG_CURSOR_MODE[31] - Hardware cursor display path */
+VIASETREG(VIA_REG_CURSOR_MODE, temp);
+}
+
+/*
+ * This function displays or hides hardware cursor (HC).
+ */
+static void
+viaDisplayHC(ScrnInfoPtr pScrn, Bool hcStatus)
+{
+VIAPtr pVia = VIAPTR(pScrn);
+uint32_t temp;
+
+temp = VIAGETREG(VIA_REG_CURSOR_MODE);
+temp &= 0xFFFE;
+temp |= hcStatus ? 0x0001 : 0x;
+
+/* VIA_REG_CURSOR_MODE[0] - Hardware Cursor Enable */
+VIASETREG(VIA_REG_CURSOR_MODE, temp);
+}
+
+static void
+viaSetHCStartingAddress(xf86CrtcPtr crtc)
+{
+drmmode_crtc_private_ptr iga = crtc->driver_private;
+ScrnInfoPtr pScrn = crtc->scrn;
+VIAPtr pVia = VIAPTR(pScrn);
+uint32_t temp;
+
+temp = VIAGETREG(VIA_REG_CURSOR_MODE);
+temp &= 0xFCFF;
+temp |= iga->cursor_bo->offset;
+
+/*
+ * 64x64 hardware cursor
+ */
+temp &= 0xFFFD;
+
+/*
+ * VIA_REG_CURSOR_MODE[25:8] - Hardware Cursor Base Address
+ */
+VIASETREG(VIA_REG_CURSOR_MODE, temp);
+}
+
+static void
+viaSetHCLocation(ScrnInfoPtr pScrn,
+int x, unsigned int xoff,
+int y, unsigned int yoff)
+{
+VIAPtr pVia = VIAPTR(pScrn);
+
+VIASETREG(VIA_REG_CURSOR_POS, ((x<< 16) | (y& 0x07ff)));
+VIASETREG(VIA_REG_CURSOR_ORG, ((xoff << 16) | (yoff & 0x07ff)));
+}
+
+static void
+viaSetHCColor(ScrnInfoPtr pScrn, int bg, int fg)
+{
+VIAPtr pVia = VIAPTR(pScrn);
+
+VIASETREG(VIA_REG_CURSOR_BG, bg);
+VIASETREG(VIA_REG_CURSOR_FG, fg);
+}
+
 static void
 viaIGA1InitHI(ScrnInfoPtr pScrn)
 {
@@ -3412,6 +3489,7 @@ via_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int 
fg)
 ScrnInfoPtr pScrn = crtc->scrn;
 drmmode_crtc_private_ptr iga = crtc->driver_private;
 xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+VIAPtr pVia = VIAPTR(pScrn);
 
 if (xf86_config->cursor_fg)
 return;
@@ -3424,10 +3502,14 @@ via_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, 
int fg)
 return;
 }
 
-if (!iga->index) {
-viaIGA1DisplayHI(pScrn, FALSE);
+if (pVia->useHardwareCursor) {
+viaSetHCColor(pScrn, bg, fg);
 } else {
-viaIGA2DisplayHI(pScrn, FALSE);
+if (!iga->index) {
+viaIGA1DisplayHI(pScrn, FALSE);
+} else {
+viaIGA2DisplayHI(pScrn, FALSE);
+}
 }
 
 xf86_config->cursor_fg = fg;
@@ -3439,6 +3521,7 @@ via_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int 
y)
 {
 ScrnInfoPtr pScrn = crtc->scrn;
 drmmode_crtc_private_ptr iga = crtc->driver_private;
+VIAPtr pVia = VIAPTR(pScrn);
 unsigned xoff, yoff;
 
 if (x < 0) {
@@ -3455,10 +3538,14 @@ via_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, 
int y)
 yoff = 0;
 }
 
-if (!ig

Re: [openchrome-devel] xf86-video-openchrome: drm.h not found at default location

2021-07-06 Thread Kevin Brace
Hi Peter,

I put in a fix for the issue you raised.

https://cgit.freedesktop.org/openchrome/xf86-video-openchrome/commit/?h=main=b4c9be7e539bde53b122ad647ba6b16dddf9aac9

If you go by the version number, Version 0.6.404 inside the 'main' branch has 
the fix.

Regards,

Kevin Brace
Brace Computer Laboratory blog
https://bracecomputerlab.com


> Date: Thu, 22 Apr 2021 17:12:45 +0200
> From: "Peter Mattern" 
> To: openchrome-devel@lists.freedesktop.org
> Subject: [openchrome-devel] xf86-video-openchrome: drm.h not found at
>   default location
> Message-ID: 
> Content-Type: text/plain; charset=utf-8
>
>
>
> Hello.
>
> At least recent versions of libdrm are putting drm.h into 
> /usr/include/*lib*drm, where it's not found by xf86-video-openchrome at 
> compile time.
> Maybe there are still operating systems around, which place it into a 
> directory 'drm', but I think the said default location should definitely be 
> taken into account by xf86-video-openchrome, too.
>
> Tested using the latest commit of branch main on Arch Linux (x86_64).
>
> Regards,
>
> Peter Mattern
>
>
>
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 2 commits - configure.ac src/openchrome_drm.h

2021-06-24 Thread Kevin Brace
 configure.ac |2 +-
 src/openchrome_drm.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 66c43d91b7e834d872a33f96fb8c5ac550f4ebfe
Author: Kevin Brace 
Date:   Thu Jun 24 14:35:18 2021 -0700

Version bumped to 0.6.404

A one line fix for a compile error that affects some users.

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 70b0190..f2f4086 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.403],
+[0.6.404],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit b4c9be7e539bde53b122ad647ba6b16dddf9aac9
Author: Kevin Brace 
Date:   Thu Jun 24 13:56:00 2021 -0700

Change how drm.h location is specified inside src/openchrome_drm.h

Several people have reported a compile error if the location of drm.h
is specified with the path.  Stop specifying the path.  Furthermore,
use double quotes rather than angle brackets when including drm.h.

Signed-off-by: Kevin Brace 

diff --git a/src/openchrome_drm.h b/src/openchrome_drm.h
index 6253612..bfa296e 100644
--- a/src/openchrome_drm.h
+++ b/src/openchrome_drm.h
@@ -32,7 +32,7 @@
 #define __OPENCHROME_DRM_H__
 
 
-#include 
+#include "drm.h"
 
 
 #if defined(__cplusplus)
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


[openchrome-devel] xf86-video-openchrome: Branch 'main' - 17 commits - src/via_display.c src/via_outputs.c src/via_ums.h

2021-05-28 Thread Kevin Brace
 src/via_display.c |  506 +-
 src/via_outputs.c |   10 -
 src/via_ums.h |   33 +++
 3 files changed, 238 insertions(+), 311 deletions(-)

New commits:
commit 9d9f47981f038bda4cb5458bdbbd4325933467a9
Author: Kevin Brace 
Date:   Fri May 28 13:30:09 2021 -0700

Merge iga*_crtc_unlock() into iga_crtc_unlock()

Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index e9d1cd2..6550869 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3173,8 +3173,15 @@ iga_crtc_lock(xf86CrtcPtr crtc)
 }
 
 static void
-iga1_crtc_unlock(xf86CrtcPtr crtc)
+iga_crtc_unlock(xf86CrtcPtr crtc)
 {
+ScrnInfoPtr pScrn = crtc->scrn;
+
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Entered %s.\n", __func__));
+
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Exiting %s.\n", __func__));
 }
 
 static Bool
@@ -3569,7 +3576,7 @@ const xf86CrtcFuncsRec iga1_crtc_funcs = {
 .save   = iga_crtc_save,
 .restore= iga_crtc_restore,
 .lock   = iga_crtc_lock,
-.unlock = iga1_crtc_unlock,
+.unlock = iga_crtc_unlock,
 .mode_fixup = iga1_crtc_mode_fixup,
 .prepare= iga_crtc_prepare,
 .mode_set   = iga_crtc_mode_set,
@@ -3589,11 +3596,6 @@ const xf86CrtcFuncsRec iga1_crtc_funcs = {
 .destroy= iga_crtc_destroy,
 };
 
-static void
-iga2_crtc_unlock(xf86CrtcPtr crtc)
-{
-}
-
 static Bool
 iga2_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
 DisplayModePtr adjusted_mode)
@@ -3727,7 +3729,7 @@ const xf86CrtcFuncsRec iga2_crtc_funcs = {
 .save   = iga_crtc_save,
 .restore= iga_crtc_restore,
 .lock   = iga_crtc_lock,
-.unlock = iga2_crtc_unlock,
+.unlock = iga_crtc_unlock,
 .mode_fixup = iga2_crtc_mode_fixup,
 .prepare= iga_crtc_prepare,
 .mode_set   = iga_crtc_mode_set,
commit 987c1379899a3c57964b8d80cd1723c0125a864a
Author: Kevin Brace 
Date:   Fri May 28 13:25:31 2021 -0700

Merge iga*_crtc_lock() into iga_crtc_lock()
    
    Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index a578549..e9d1cd2 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3159,8 +3159,16 @@ iga_crtc_restore(xf86CrtcPtr crtc)
 }
 
 static Bool
-iga1_crtc_lock(xf86CrtcPtr crtc)
+iga_crtc_lock(xf86CrtcPtr crtc)
 {
+ScrnInfoPtr pScrn = crtc->scrn;
+
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Entered %s.\n", __func__));
+
+DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+"Exiting %s.\n", __func__));
+
 return FALSE;
 }
 
@@ -3560,7 +3568,7 @@ const xf86CrtcFuncsRec iga1_crtc_funcs = {
 .dpms   = iga_crtc_dpms,
 .save   = iga_crtc_save,
 .restore= iga_crtc_restore,
-.lock   = iga1_crtc_lock,
+.lock   = iga_crtc_lock,
 .unlock = iga1_crtc_unlock,
 .mode_fixup = iga1_crtc_mode_fixup,
 .prepare= iga_crtc_prepare,
@@ -3581,12 +3589,6 @@ const xf86CrtcFuncsRec iga1_crtc_funcs = {
 .destroy= iga_crtc_destroy,
 };
 
-static Bool
-iga2_crtc_lock(xf86CrtcPtr crtc)
-{
-return FALSE;
-}
-
 static void
 iga2_crtc_unlock(xf86CrtcPtr crtc)
 {
@@ -3724,7 +3726,7 @@ const xf86CrtcFuncsRec iga2_crtc_funcs = {
 .dpms   = iga_crtc_dpms,
 .save   = iga_crtc_save,
 .restore= iga_crtc_restore,
-.lock   = iga2_crtc_lock,
+.lock   = iga_crtc_lock,
 .unlock = iga2_crtc_unlock,
 .mode_fixup = iga2_crtc_mode_fixup,
 .prepare= iga_crtc_prepare,
commit bc4fafc177d3053ca7dd3a5cd522017a3254b2f3
Author: Kevin Brace 
Date:   Fri May 28 13:18:53 2021 -0700

Merge iga*_crtc_set_origin() into iga_crtc_set_origin()

Signed-off-by: Kevin Brace 

diff --git a/src/via_display.c b/src/via_display.c
index 394d565..a578549 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3241,21 +3241,6 @@ iga_crtc_prepare(xf86CrtcPtr crtc)
 "Exiting %s.\n", __func__));
 }
 
-static void
-iga1_crtc_set_origin(xf86CrtcPtr crtc, int x, int y)
-{
-ScrnInfoPtr pScrn = crtc->scrn;
-
-DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"Entered iga1_crtc_set_origin.\n"));
-
-viaIGA1SetFBStartingAddress(crtc, x, y);
-VIAVidAdjustFrame(pScrn, x, y);
-
-DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-&qu

[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.14'

2021-05-22 Thread Kevin Brace
New branch 'drm-next-5.14' available with the following commits:
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


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

2021-05-22 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_display.c |6 ++---
 drivers/gpu/drm/openchrome/openchrome_drv.c |6 -
 drivers/gpu/drm/openchrome/openchrome_drv.h |6 +
 drivers/gpu/drm/openchrome/openchrome_hdmi.c|5 
 drivers/gpu/drm/openchrome/openchrome_init.c|   26 
 5 files changed, 36 insertions(+), 13 deletions(-)

New commits:
commit 83ab468a2495dcfedd17e136947143f2118653a5
Author: Kevin Brace 
Date:   Fri May 21 14:03:59 2021 -0700

drm/openchrome: Version bumped to 3.4.9

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 71a04a9e8633..f618d625c17b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,10 +61,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   4
-#define DRIVER_PATCHLEVEL  8
+#define DRIVER_PATCHLEVEL  9
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20210403"
+#define DRIVER_DATE"20210521"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit d1545ee25fb15c09a377add338be33db62987470
Author: Kevin Brace 
Date:   Fri May 21 13:59:10 2021 -0700

drm/openchrome: Move openchrome_hdmi_audio variable

Move it into openchrome_hdmi.c where it belongs.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c 
b/drivers/gpu/drm/openchrome/openchrome_drv.c
index e478fd8a139a..0181402b34bb 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -49,12 +49,6 @@ MODULE_PARM_DESC(modeset, "Enable DRM device driver "
"1 = Enabled)");
 module_param_named(modeset, openchrome_modeset, int, 0400);
 
-int openchrome_hdmi_audio = 0;
-
-MODULE_PARM_DESC(audio, "HDMI Audio enable (1 = enable)");
-module_param_named(audio, openchrome_hdmi_audio, int, 0444);
-
-
 static int openchrome_driver_open(struct drm_device *dev,
struct drm_file *file_priv)
 {
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 4411e6c0282c..71a04a9e8633 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -368,8 +368,6 @@ disable_second_display_channel(void __iomem *regs)
 extern const struct drm_ioctl_desc openchrome_driver_ioctls[];
 extern int openchrome_driver_num_ioctls;
 
-extern int openchrome_hdmi_audio;
-
 extern struct ttm_device_funcs openchrome_bo_driver;
 
 int openchrome_vram_detect(struct openchrome_drm_private *dev_private);
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c 
b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index 59285de44e00..568ea2068504 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -36,6 +36,11 @@
 
 #define HDMI_AUDIO_ENABLED BIT(0)
 
+int openchrome_hdmi_audio = 0;
+
+MODULE_PARM_DESC(audio, "HDMI Audio enable (1 = enable)");
+module_param_named(audio, openchrome_hdmi_audio, int, 0444);
+
 /*
  * Routines for controlling stuff on the HDMI port
  */
commit 3d2d1eaea1a5bc5f83f36f1e5a46a9232a7d0fca
Author: Kevin Brace 
Date:   Fri May 21 13:52:19 2021 -0700

drm/openchrome: Be strict about case statement fall through

Eclipse CDT code analyzer pointed out several case statements were
not using a corresponding break statement in pair, and instead were
relying on falling through to the next case statement's break
    statement or terminating with the end of switch statement.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c 
b/drivers/gpu/drm/openchrome/openchrome_display.c
index 89f835c664c9..e33df4f7c1a1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -132,9 +132,9 @@ via_encoder_commit(struct drm_encoder *encoder)
svga_wseq_mask(VGABASE, 0x1E, 0x30, BIT(5) | BIT(4));
break;
 
+   case VIA_DI_PORT_NONE:
default:
DRM_ERROR("Unsupported DIPort.\n");
-   case VIA_DI_PORT_NONE:
break;
}
 
@@ -192,9 +192,9 @@ via_encoder_disable(struct drm_encoder *encoder)
BIT(3) | BIT(2) | BIT(1) | BIT(0));
break;
 
+   case VIA_DI_PORT_NONE:
default:
DRM_ERROR("Unsupported DIPort.\n");
-   case VIA_DI_PORT_NONE:
break;
}
 }
@@ -236,9 +236,9 @@ via_set_sync_polarity(struct drm_encoder *encoder, struct 
drm_display_mode *mode
s

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.13' - 24 commits - drivers/gpu/drm drivers/video/fbdev

2021-05-14 Thread Kevin Brace
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|   28 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  184 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   |3 
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c   |   19 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c|6 
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h|1 
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c |   13 
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c |4 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   68 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c |2 
 drivers/gpu/drm/amd/pm/amdgpu_pm.c|   10 
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c   |5 
 drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c   |4 
 drivers/gpu/drm/i915/gvt/handlers.c   |6 
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c  |   10 
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c |   16 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h |6 
 drivers/gpu/drm/radeon/radeon_atombios.c  |   26 +
 drivers/video/fbdev/core/fbmem.c  |2 
 19 files changed, 332 insertions(+), 81 deletions(-)

New commits:
commit 1a17b6532d4f06cf48b4eca656eb8f7be5e6ba8e
Merge: c3588b84799e 0844708ac3d2
Author: Kevin Brace 
Date:   Fri May 14 20:41:29 2021 -0700

Merge tag 'drm-next-2021-05-10' of git://anongit.freedesktop.org/drm/drm 
into drm-next-5.13

drm fixes for 5.13-rc1

amdgpu:
- MPO hang workaround
- Fix for concurrent VM flushes on vega/navi
- dcefclk is not adjustable on navi1x and newer
- MST HPD debugfs fix
- Suspend/resumes fixes
- Register VGA clients late in case driver fails to load
- Fix GEM leak in user framebuffer create
- Add support for polaris12 with 32 bit memory interface
- Fix duplicate cursor issue when using overlay
- Fix corruption with tiled surfaces on VCN3
- Add BO size and stride check to fix BO size verification

radeon:
- Fix off-by-one in power state parsing
- Fix possible memory leak in power state parsing

msm:
- NULL ptr dereference fix

fbdev:
- procfs disabled warning fix

i915:
- gvt: Fix a possible division by zero in vgpu display rate calculation

commit 0844708ac3d2dbdace70f4a6020669d56958697f
Merge: 59e528c5bc58 234055fd9728
Author: Dave Airlie 
Date:   Fri May 7 12:44:50 2021 +1000

Merge tag 'amd-drm-fixes-5.13-2021-05-05' of 
https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-fixes-5.13-2021-05-05:

amdgpu:
- MPO hang workaround
- Fix for concurrent VM flushes on vega/navi
- dcefclk is not adjustable on navi1x and newer
- MST HPD debugfs fix
- Suspend/resumes fixes
- Register VGA clients late in case driver fails to load
- Fix GEM leak in user framebuffer create
- Add support for polaris12 with 32 bit memory interface
- Fix duplicate cursor issue when using overlay
- Fix corruption with tiled surfaces on VCN3
- Add BO size and stride check to fix BO size verification

radeon:
- Fix off-by-one in power state parsing
- Fix possible memory leak in power state parsing

Signed-off-by: Dave Airlie 
From: Alex Deucher 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20210506033929.3875-1-alexander.deuc...@amd.com

diff --cc drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 2e622c1675d7,dab98a1fdcaa..8a1fb8b6606e
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@@ -902,25 -1070,10 +1070,23 @@@ int amdgpu_display_gem_fb_verify_and_in
int ret;
  
rfb->base.obj[0] = obj;
- 
-   /* Verify that bo size can fit the fb size. */
-   ret = drm_gem_fb_init_with_funcs(dev, >base, file_priv, mode_cmd,
-_fb_funcs);
+   drm_helper_mode_fill_fb_struct(dev, >base, mode_cmd);
+   ret = drm_framebuffer_init(dev, >base, _fb_funcs);
if (ret)
goto err;
 +  /* Verify that the modifier is supported. */
 +  if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format,
 +mode_cmd->modifier[0])) {
 +  struct drm_format_name_buf format_name;
 +  drm_dbg_kms(dev,
 +  "unsupported pixel format %s / modifier 0x%llx\n",
 +  drm_get_format_name(mode_cmd->pixel_format,
 +  _name),
 +  mode_cmd->modifier[0]);
 +
 +  ret = -EINVAL;
 +  goto err;
 +  }
  
ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);
if (ret)
commit 59e528c5bc58

[openchrome-devel] xf86-video-openchrome: Branch 'main' - 7 commits - configure.ac src/via_analog.c src/via_driver.c src/via_driver.h src/via_options.c src/via_tv.c src/via_vgahw.c src/via_vgahw.h

2021-05-14 Thread Kevin Brace
 configure.ac  |2 -
 src/via_analog.c  |2 -
 src/via_driver.c  |   26 ++-
 src/via_driver.h  |2 -
 src/via_options.c |   26 ---
 src/via_tv.c  |5 
 src/via_vgahw.c   |   59 --
 src/via_vgahw.h   |7 --
 8 files changed, 14 insertions(+), 115 deletions(-)

New commits:
commit 8dc4cf170e79e1759caf2c57a3a17c8b913e0587
Author: Kevin Brace 
Date:   Mon May 10 13:22:13 2021 -0700

Version bumped to 0.6.402

Signed-off-by: Kevin Brace 

diff --git a/configure.ac b/configure.ac
index 9a6646d..5ae93bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-openchrome],
-[0.6.401],
+[0.6.402],
 
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg=Driver/openchrome],
 [xf86-video-openchrome])
 
commit efca44948bdf4811238e3f49b2b59c63dae155a6
Author: Kevin Brace 
Date:   Mon May 10 13:21:56 2021 -0700

Discontinue undocumented PrintTVRegs option

Signed-off-by: Kevin Brace 

diff --git a/src/via_driver.c b/src/via_driver.c
index 1102b78..e50cbfd 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1689,14 +1689,6 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
 if (serverGeneration == 1)
 xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
 
-#ifdef HAVE_DEBUG
-if (pVia->PrintTVRegs) {
-xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"Printing TV registers.\n");
-ViaTVPrintRegs(pScrn);
-}
-#endif
-
 DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 "Exiting %s.\n", __func__));
 return TRUE;
diff --git a/src/via_driver.h b/src/via_driver.h
index 74c3c0c..d175069 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -361,7 +361,6 @@ typedef struct _VIA {
 #ifdef HAVE_DEBUG
 BooldisableXvBWCheck;
 BoolDumpVGAROM;
-BoolPrintTVRegs;
 #endif /* HAVE_DEBUG */
 
 video_via_regs* VideoRegs;
diff --git a/src/via_options.c b/src/via_options.c
index b347898..1d4c79b 100644
--- a/src/via_options.c
+++ b/src/via_options.c
@@ -63,9 +63,6 @@ typedef enum
 } VIAOpts;
 
 static OptionInfoRec VIAOptions[] = {
-#ifdef HAVE_DEBUG /* Don't document these three. */
-{OPTION_PRINTTVREGS, "PrintTVRegs",  OPTV_BOOLEAN, {0}, FALSE},
-#endif
 {OPTION_NOACCEL, "NoAccel",  OPTV_BOOLEAN, {0}, FALSE},
 {OPTION_EXA_NOCOMPOSITE, "ExaNoComposite",   OPTV_BOOLEAN, {0}, FALSE},
 {OPTION_EXA_SCRATCH_SIZE,"ExaScratchSize",   OPTV_INTEGER, {0}, FALSE},
diff --git a/src/via_tv.c b/src/via_tv.c
index d70b810..26a34d8 100644
--- a/src/via_tv.c
+++ b/src/via_tv.c
@@ -873,11 +873,6 @@ via_tv_init(ScrnInfoPtr pScrn)
 /* Save now */
 pVIADisplay->TVSave(pScrn);
 
-#ifdef HAVE_DEBUG
-if (VIAPTR(pScrn)->PrintTVRegs)
-pVIADisplay->TVPrintRegs(pScrn);
-#endif
-
 DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 "Exiting via_tv_init.\n"));
 return TRUE;
commit a0a8a194397c01482c8d2825127be547fac25ee9
Author: Kevin Brace 
Date:   Mon May 10 13:21:13 2021 -0700

Discontinue undocumented PrintVGARegs option

Signed-off-by: Kevin Brace 

diff --git a/src/via_driver.c b/src/via_driver.c
index 9fd87d6..1102b78 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1690,12 +1690,6 @@ VIAScreenInit(SCREEN_INIT_ARGS_DECL)
 xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
 
 #ifdef HAVE_DEBUG
-if (pVia->PrintVGARegs) {
-xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-"Printing VGA registers.\n");
-ViaVgahwPrint(VGAHWPTR(pScrn));
-}
-
 if (pVia->PrintTVRegs) {
 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 "Printing TV registers.\n");
diff --git a/src/via_driver.h b/src/via_driver.h
index 73686f0..74c3c0c 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -361,7 +361,6 @@ typedef struct _VIA {
 #ifdef HAVE_DEBUG
 BooldisableXvBWCheck;
 BoolDumpVGAROM;
-BoolPrintVGARegs;
 BoolPrintTVRegs;
 #endif /* HAVE_DEBUG */
 
diff --git a/src/via_options.c b/src/via_options.c
index 755b776..b347898 100644
--- a/src/via_options.c
+++ b/src/via_options.c
@@ -38,7 +38,6 @@
 typedef enum
 {
 #ifdef HAVE_DEBUG
-OPTION_PRINTVGAREGS,
 OPTION_PRINTTVREGS,
 #endif
 OPTION_NOACCEL,
@@ -65,7 +64,6 @@ typedef enum
 
 static OptionInfoRec VIAOptions[] = {
 #ifdef HAVE_DEBUG /* Don't document these three. */
-{OPTION_PRINTVGAREGS,"PrintVGARegs", OPTV_BOOLEAN, {0}, FALSE},
 {OPTION_PRINTTVREGS, "PrintTVRegs",  OPTV_BOOLEAN, {0}, FALSE},
 #end

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.13' - 8 commits - drivers/gpu/drm

2021-05-14 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_crtc.c   |   39 +--
 drivers/gpu/drm/openchrome/openchrome_cursor.c |   41 +++--
 drivers/gpu/drm/openchrome/openchrome_drv.h|6 +--
 drivers/gpu/drm/openchrome/openchrome_object.c |   11 ++
 drivers/gpu/drm/openchrome/openchrome_ttm.c|6 +--
 5 files changed, 57 insertions(+), 46 deletions(-)

New commits:
commit c3588b84799e3ac2bad1e73b2b076816a3363a1c
Author: Kevin Brace 
Date:   Fri May 14 20:15:31 2021 -0700

drm: Use state helper instead of the plane state pointer

Based on commit 37418bf (drm: Use state helper instead of the plane
state pointer).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index 44005587ab18..0ce9af620d01 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1886,7 +1886,8 @@ static void openchrome_primary_atomic_disable(struct 
drm_plane *plane,
 void openchrome_primary_atomic_update(struct drm_plane *plane,
struct drm_atomic_state *state)
 {
-   struct drm_plane_state *new_state = plane->state;
+   struct drm_plane_state *new_state =
+   drm_atomic_get_new_plane_state(state, plane);
struct drm_crtc *crtc = new_state->crtc;
struct drm_framebuffer *fb = new_state->fb;
uint32_t pitch = (new_state->crtc_y * fb->pitches[0]) +
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c 
b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index dcd8eaab4c5c..ab870ede2035 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -357,7 +357,8 @@ exit:
 static void openchrome_cursor_atomic_update(struct drm_plane *plane,
struct drm_atomic_state *state)
 {
-   struct drm_plane_state *new_state = plane->state;
+   struct drm_plane_state *new_state =
+   drm_atomic_get_new_plane_state(state, plane);
struct drm_plane_state *old_state =
drm_atomic_get_old_plane_state(state, plane);
struct drm_crtc *crtc = new_state->crtc;
@@ -383,7 +384,8 @@ static void openchrome_cursor_atomic_update(struct 
drm_plane *plane,
 void openchrome_cursor_atomic_disable(struct drm_plane *plane,
struct drm_atomic_state *state)
 {
-   struct drm_plane_state *new_state = plane->state;
+   struct drm_plane_state *new_state =
+   drm_atomic_get_new_plane_state(state, plane);
struct drm_device *dev = plane->dev;
struct drm_crtc *crtc = new_state->crtc;
 
commit dca26c46653aa06c97fadb8abb2390a31fe90073
Author: Kevin Brace 
Date:   Fri May 14 20:15:24 2021 -0700

drm/atomic: Pass the full state to planes atomic disable and update

Based on commit 977697e (drm/atomic: Pass the full state to planes
atomic disable and update).

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c 
b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index e025c9c905f3..44005587ab18 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1875,7 +1875,7 @@ exit:
 }
 
 static void openchrome_primary_atomic_disable(struct drm_plane *plane,
-   struct drm_plane_state *old_state)
+   struct drm_atomic_state *state)
 {
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
@@ -1884,7 +1884,7 @@ static void openchrome_primary_atomic_disable(struct 
drm_plane *plane,
 }
 
 void openchrome_primary_atomic_update(struct drm_plane *plane,
-   struct drm_plane_state *old_state)
+   struct drm_atomic_state *state)
 {
struct drm_plane_state *new_state = plane->state;
struct drm_crtc *crtc = new_state->crtc;
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c 
b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 2b56b0409887..dcd8eaab4c5c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -355,9 +355,11 @@ exit:
 }
 
 static void openchrome_cursor_atomic_update(struct drm_plane *plane,
-   struct drm_plane_state *old_state)
+   struct drm_atomic_state *state)
 {
struct drm_plane_state *new_state = plane->state;
+   struct drm_plane_state *old_state =
+   drm_atomic_get_old_plane_state(state, plane);
struct drm_crtc *crtc = new_state->crtc;
struct openchrome_bo *bo;
struct drm_gem_object *gem;
@@ -379,7 +381,7 @@ static void openchrome_cursor_atomic_update(struct 
drm_plane

[openchrome-devel] drm-openchrome: Branch 'drm-next-5.13' - 2 commits - drivers/gpu/drm

2021-04-03 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_drv.c |   31 ++--
 drivers/gpu/drm/openchrome/openchrome_drv.h |4 +--
 2 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit db2ffb68e14680f8e319d4b32a035248b6529b9e
Author: Kevin Brace 
Date:   Sat Apr 3 17:15:16 2021 -0700

drm/openchrome: Version bumped to 3.4.8

This version adds modeset kernel parameter.  Now, OpenChrome
DRM is by default disabled.  To activate OpenChrome DRM, add
openchrome.modeset=1 to the kernel command line.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index a36cb5939968..3327cf3f3005 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,10 +61,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   4
-#define DRIVER_PATCHLEVEL  7
+#define DRIVER_PATCHLEVEL  8
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20210402"
+#define DRIVER_DATE"20210403"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit b0c9a88eca052c8384152c94a22af16e5ab03c73
Author: Kevin Brace 
Date:   Sat Apr 3 17:06:31 2021 -0700

drm/openchrome: Add modeset kernel parameter

modeset kernel parameter will enable / disable this device driver.
The default setting disables this device driver since it is still
    experimental.

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c 
b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 7877ef1dee1f..e478fd8a139a 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -27,6 +27,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include 
 #include 
 
 #include 
@@ -36,6 +37,18 @@
 #include "openchrome_drv.h"
 
 
+/*
+ * For now, this device driver will be disabled, unless the
+ * user decides to enable it.
+ */
+int openchrome_modeset = 0;
+
+MODULE_PARM_DESC(modeset, "Enable DRM device driver "
+   "(Default: Disabled, "
+   "0 = Disabled,"
+   "1 = Enabled)");
+module_param_named(modeset, openchrome_modeset, int, 0400);
+
 int openchrome_hdmi_audio = 0;
 
 MODULE_PARM_DESC(audio, "HDMI Audio enable (1 = enable)");
@@ -250,14 +263,24 @@ static struct pci_driver openchrome_pci_driver = {
 
 static int __init openchrome_init(void)
 {
-   int ret;
+   int ret = 0;
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
+   if ((openchrome_modeset == -1) &&
+   (vgacon_text_force())) {
+   openchrome_modeset = 0;
+   }
+
+   if (!openchrome_modeset) {
+   goto exit;
+   }
+
openchrome_driver.num_ioctls = openchrome_driver_num_ioctls;
 
ret = pci_register_driver(_pci_driver);
 
+exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
return ret;
 }
@@ -266,8 +289,12 @@ static void __exit openchrome_exit(void)
 {
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   pci_unregister_driver(_pci_driver);
+   if (!openchrome_modeset) {
+   goto exit;
+   }
 
+   pci_unregister_driver(_pci_driver);
+exit:
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.13'

2021-04-03 Thread Kevin Brace
New branch 'drm-next-5.13' available with the following commits:
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


[openchrome-devel] drm-openchrome: Branch 'drm-next-5.12' - 6 commits - drivers/gpu/drm

2021-04-02 Thread Kevin Brace
 drivers/gpu/drm/openchrome/openchrome_drv.c|   84 +
 drivers/gpu/drm/openchrome/openchrome_drv.h|   11 +--
 drivers/gpu/drm/openchrome/openchrome_hdmi.c   |2 
 drivers/gpu/drm/openchrome/openchrome_ioctl.c  |4 -
 drivers/gpu/drm/openchrome/openchrome_object.c |   23 ++
 5 files changed, 64 insertions(+), 60 deletions(-)

New commits:
commit f66ac1c2dd3c65ca3d035407217a2a289c615d6f
Author: Kevin Brace 
Date:   Fri Apr 2 09:33:50 2021 -0700

drm/openchrome: Version bumped to 3.4.7

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 1c0f08da78c6..a36cb5939968 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,10 +61,10 @@
 
 #define DRIVER_MAJOR   3
 #define DRIVER_MINOR   4
-#define DRIVER_PATCHLEVEL  6
+#define DRIVER_PATCHLEVEL  7
 #define DRIVER_NAME"openchrome"
 #define DRIVER_DESC"OpenChrome DRM for VIA Technologies Chrome IGP"
-#define DRIVER_DATE"20210331"
+#define DRIVER_DATE"20210402"
 #define DRIVER_AUTHOR  "OpenChrome Project"
 
 
commit bcb616948ba00a93360139beafa1976891b78da1
Author: Kevin Brace 
Date:   Fri Apr 2 09:29:51 2021 -0700

drm/openchrome: Change openchrome_driver{} member names

Signed-off-by: Kevin Brace 

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c 
b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 6a7eaa9855a5..7877ef1dee1f 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -42,7 +42,7 @@ MODULE_PARM_DESC(audio, "HDMI Audio enable (1 = enable)");
 module_param_named(audio, openchrome_hdmi_audio, int, 0444);
 
 
-static int openchrome_drm_driver_open(struct drm_device *dev,
+static int openchrome_driver_open(struct drm_device *dev,
struct drm_file *file_priv)
 {
int ret = 0;
@@ -53,7 +53,7 @@ static int openchrome_drm_driver_open(struct drm_device *dev,
return ret;
 }
 
-static void openchrome_drm_driver_postclose(struct drm_device *dev,
+static void openchrome_driver_postclose(struct drm_device *dev,
struct drm_file *file_priv)
 {
DRM_DEBUG_KMS("Entered %s.\n", __func__);
@@ -61,7 +61,7 @@ static void openchrome_drm_driver_postclose(struct drm_device 
*dev,
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void openchrome_drm_driver_lastclose(struct drm_device *dev)
+static void openchrome_driver_lastclose(struct drm_device *dev)
 {
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
@@ -70,7 +70,7 @@ static void openchrome_drm_driver_lastclose(struct drm_device 
*dev)
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static int openchrome_drm_driver_dumb_create(
+static int openchrome_driver_dumb_create(
struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args)
@@ -114,7 +114,7 @@ exit:
return ret;
 }
 
-static int openchrome_drm_driver_dumb_map_offset(
+static int openchrome_driver_dumb_map_offset(
struct drm_file *file_priv,
struct drm_device *dev,
uint32_t handle,
@@ -156,13 +156,12 @@ static struct drm_driver openchrome_driver = {
DRIVER_GEM |
DRIVER_MODESET |
DRIVER_ATOMIC,
-   .open = openchrome_drm_driver_open,
-   .postclose = openchrome_drm_driver_postclose,
-   .lastclose = openchrome_drm_driver_lastclose,
-   .dumb_create = openchrome_drm_driver_dumb_create,
-   .dumb_map_offset =
-   openchrome_drm_driver_dumb_map_offset,
-   .ioctls = openchrome_ioctls,
+   .open = openchrome_driver_open,
+   .postclose = openchrome_driver_postclose,
+   .lastclose = openchrome_driver_lastclose,
+   .dumb_create = openchrome_driver_dumb_create,
+   .dumb_map_offset = openchrome_driver_dumb_map_offset,
+   .ioctls = openchrome_driver_ioctls,
.fops = _driver_fops,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
@@ -255,7 +254,7 @@ static int __init openchrome_init(void)
 
DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-   openchrome_driver.num_ioctls = openchrome_max_ioctl;
+   openchrome_driver.num_ioctls = openchrome_driver_num_ioctls;
 
ret = pci_register_driver(_pci_driver);
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h 
b/drivers/gpu/drm/openchrome/openchrome_drv.h
index fe9b7bcdff79..1c0f08da78c6 100644
--- a/

[openchrome-devel] drm-openchrome: Changes to 'drm-next-5.12'

2021-03-31 Thread Kevin Brace
New branch 'drm-next-5.12' available with the following commits:
___
openchrome-devel mailing list
openchrome-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/openchrome-devel


  1   2   3   4   5   6   7   8   9   >