From 21a656460f216ed4d8b59de4838202dda64b57a4 Mon Sep 17 00:00:00 2001
From: Rudolf Cornelissen
Date: Mon, 2 Nov 2009 19:27:15 +0000
Subject: [PATCH] matrox G450/G550 (apparantly) can do HDTV overlay (720p,
1080p). Bumped version to 0.33.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33865 a95241bf-73f2-0310-859d-f6bbb57e9c96
---
src/add-ons/accelerants/matrox/Overlay.c | 50 +++++++++++++------
.../accelerants/matrox/engine/mga_bes.c | 17 +++----
.../accelerants/matrox/engine/mga_general.c | 2 +-
.../drivers/graphics/matrox/UPDATE.html | 6 ++-
4 files changed, 48 insertions(+), 27 deletions(-)
diff --git a/src/add-ons/accelerants/matrox/Overlay.c b/src/add-ons/accelerants/matrox/Overlay.c
index 313eebf38c..cd8e7d9a06 100644
--- a/src/add-ons/accelerants/matrox/Overlay.c
+++ b/src/add-ons/accelerants/matrox/Overlay.c
@@ -1,4 +1,4 @@
-/* Written by Rudolf Cornelissen 05-2002/4-2006 */
+/* Written by Rudolf Cornelissen 05-2002/11-2009 */
/* Note on 'missing features' in BeOS 5.0.3 and DANO:
* BeOS needs to define more colorspaces! It would be nice if BeOS would support the FourCC 'definitions'
@@ -175,24 +175,44 @@ const overlay_buffer *ALLOCATE_OVERLAY_BUFFER(color_space cs, uint16 width, uint
}
/* check if the requested buffer width is supported */
- if (si->overlay.myBuffer[offset].width > 1024)
- {
- LOG(4,("Overlay: Sorry, requested buffer width not supported, aborted\n"));
+ if (si->ps.card_type < G450) {
+ if (si->overlay.myBuffer[offset].width > 1024) {
+ LOG(4,("Overlay: Sorry, requested buffer width not supported, aborted\n"));
- /* release the shared benaphore */
- RELEASE_BEN(si->overlay.lock)
+ /* release the shared benaphore */
+ RELEASE_BEN(si->overlay.lock)
- return NULL;
- }
- /* check if the requested buffer height is supported */
- if (height > 1024)
- {
- LOG(4,("Overlay: Sorry, requested buffer height not supported, aborted\n"));
+ return NULL;
+ }
- /* release the shared benaphore */
- RELEASE_BEN(si->overlay.lock)
+ /* check if the requested buffer height is supported */
+ if (height > 1024) {
+ LOG(4,("Overlay: Sorry, requested buffer height not supported, aborted\n"));
- return NULL;
+ /* release the shared benaphore */
+ RELEASE_BEN(si->overlay.lock)
+
+ return NULL;
+ }
+ } else {
+ if (si->overlay.myBuffer[offset].width > 1920) {
+ LOG(4,("Overlay: Sorry, requested buffer width not supported, aborted\n"));
+
+ /* release the shared benaphore */
+ RELEASE_BEN(si->overlay.lock)
+
+ return NULL;
+ }
+
+ /* check if the requested buffer height is supported */
+ if (height > 1080) {
+ LOG(4,("Overlay: Sorry, requested buffer height not supported, aborted\n"));
+
+ /* release the shared benaphore */
+ RELEASE_BEN(si->overlay.lock)
+
+ return NULL;
+ }
}
/* store slopspace (in pixels) for each bitmap for use by 'overlay unit' (BES) */
diff --git a/src/add-ons/accelerants/matrox/engine/mga_bes.c b/src/add-ons/accelerants/matrox/engine/mga_bes.c
index 99c48f2b4b..ec920884ff 100644
--- a/src/add-ons/accelerants/matrox/engine/mga_bes.c
+++ b/src/add-ons/accelerants/matrox/engine/mga_bes.c
@@ -1,5 +1,5 @@
/* G200-G550 Back End Scaler functions */
-/* Written by Rudolf Cornelissen 05/2002-12/2005 */
+/* Written by Rudolf Cornelissen 05/2002-11/2009 */
#define MODULE_BIT 0x00000200
@@ -207,7 +207,7 @@ static void gx00_bes_calc_move_overlay(move_overlay_info *moi)
/* take zoom into account */
moi->hsrcstv += ((uint32)si->overlay.my_ov.h_start) << 16;
/* AND below required by hardware */
- moi->hsrcstv &= 0x03fffffc;
+ moi->hsrcstv &= 0x07fffffc;
LOG(4,("Overlay: first hor. (sub)pixel of input bitmap contributing %f\n", moi->hsrcstv / (float)65536));
/* Setup horizontal source end: last (sub)pixel contributing to output picture */
@@ -247,7 +247,7 @@ static void gx00_bes_calc_move_overlay(move_overlay_info *moi)
moi->hsrcendv = (((uint32)((si->overlay.my_ov.h_start + si->overlay.my_ov.width) - 1)) << 16);
}
/* AND below required by hardware */
- moi->hsrcendv &= 0x03fffffc;
+ moi->hsrcendv &= 0x07fffffc;
LOG(4,("Overlay: last horizontal (sub)pixel of input bitmap contributing %f\n", moi->hsrcendv / (float)65536));
@@ -581,13 +581,13 @@ status_t gx00_configure_bes
* this is the last pixel that will be used for calculating interpolated pixels */
hsrclstv = ((ob->width - 1) - si->overlay.myBufInfo[offset].slopspace) << 16;
/* AND below required by hardware */
- hsrclstv &= 0x03ff0000;
+ hsrclstv &= 0x07ff0000;
/* setup field 1 (is our complete frame) vertical source last position.
* this is the last pixel that will be used for calculating interpolated pixels */
v1srclstv = (ob->height - 1);
/* AND below required by hardware */
- v1srclstv &= 0x000003ff;
+ v1srclstv &= 0x000007ff;
/*****************************
@@ -670,13 +670,10 @@ status_t gx00_configure_bes
LOG(6,("Overlay: using horizontal dropping or replication on scaling\n"));
}
/* enable vertical filtering on scaling if asked for: if we are *upscaling* only */
- if ((ow->flags & B_OVERLAY_VERTICAL_FILTERING) && (viscalv < (0x01 << 16)))
- {
+ if ((ow->flags & B_OVERLAY_VERTICAL_FILTERING) && (viscalv < (0x01 << 16)) && (ob->width <= 1024)) {
ctlv |= 1 << 11;
LOG(6,("Overlay: using vertical interpolation on scaling\n"));
- }
- else
- {
+ } else {
ctlv |= 0 << 11;
LOG(6,("Overlay: using vertical dropping or replication on scaling\n"));
}
diff --git a/src/add-ons/accelerants/matrox/engine/mga_general.c b/src/add-ons/accelerants/matrox/engine/mga_general.c
index 153b0a2fbb..f73f47d024 100644
--- a/src/add-ons/accelerants/matrox/engine/mga_general.c
+++ b/src/add-ons/accelerants/matrox/engine/mga_general.c
@@ -54,7 +54,7 @@ status_t gx00_general_powerup()
status_t status;
uint8 card_class;
- LOG(1,("POWERUP: Haiku Matrox Accelerant 0.32 running.\n"));
+ LOG(1,("POWERUP: Haiku Matrox Accelerant 0.33 running.\n"));
/* log VBLANK INT usability status */
if (si->ps.int_assigned)
diff --git a/src/add-ons/kernel/drivers/graphics/matrox/UPDATE.html b/src/add-ons/kernel/drivers/graphics/matrox/UPDATE.html
index 23be039f70..e88505e2e5 100644
--- a/src/add-ons/kernel/drivers/graphics/matrox/UPDATE.html
+++ b/src/add-ons/kernel/drivers/graphics/matrox/UPDATE.html
@@ -4,7 +4,7 @@
Changes done for each driverversion:
-head (svn 0.32, Rudolf)
+head (svn 0.33, Rudolf)
- G100-G200:
@@ -20,6 +20,10 @@
- Coldstarting now works on more cards: fixed RAM reset trouble so RAM access now works (no more ghosting on the screen).
+- G450-G550:
+
+- Hardware overlay now also works for HDTV video (720p, 1080p).
+
- General:
- Hook GET_ACCELERANT_DEVICE_INFO now returns more detailed info about the card in use;