From ce6115a18015b75b1f9c2ad8d7d68be31dfd448a Mon Sep 17 00:00:00 2001
From: Rudolf Cornelissen
Date: Fri, 1 May 2009 15:05:43 +0000
Subject: [PATCH] added support for all HDTV modes video overlay for all
GeForce cards that have overlay support. TNT1/2/2-M64 users remain in bitmap
mode: the overlay engine there can't handle above DVD quality. Bumped version
to 0.88.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30535 a95241bf-73f2-0310-859d-f6bbb57e9c96
---
src/add-ons/accelerants/nvidia/Overlay.c | 56 +++++++++++++------
.../accelerants/nvidia/engine/nv_bes.c | 6 +-
.../accelerants/nvidia/engine/nv_general.c | 2 +-
.../drivers/graphics/nvidia/UPDATE.html | 6 +-
4 files changed, 47 insertions(+), 23 deletions(-)
diff --git a/src/add-ons/accelerants/nvidia/Overlay.c b/src/add-ons/accelerants/nvidia/Overlay.c
index 30d37420a6..c7287a866d 100644
--- a/src/add-ons/accelerants/nvidia/Overlay.c
+++ b/src/add-ons/accelerants/nvidia/Overlay.c
@@ -1,4 +1,4 @@
-/* Written by Rudolf Cornelissen 05/2002-4/2006 */
+/* Written by Rudolf Cornelissen 05/2002-5/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'
@@ -133,25 +133,49 @@ const overlay_buffer *ALLOCATE_OVERLAY_BUFFER(color_space cs, uint16 width, uint
break;
}
- /* 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"));
+ /* checkout input picture size */
+ switch (si->ps.card_arch) {
+ case NV04A:
+ /* all DVD's are OK, but HDTV 1280x720p is not: it displays ghost images
+ * (still find exact limit..) */
- /* release the shared benaphore */
- RELEASE_BEN(si->overlay.lock)
+ /* 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"));
- return NULL;
- }
- /* check if the requested buffer height is supported */
- if (height > 1024)
- {
- LOG(4,("Overlay: Sorry, requested buffer height 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 > 1024) {
+ LOG(4,("Overlay: Sorry, requested buffer height not supported, aborted\n"));
- /* release the shared benaphore */
- RELEASE_BEN(si->overlay.lock)
+ /* release the shared benaphore */
+ RELEASE_BEN(si->overlay.lock)
+ return NULL;
+ }
+ break;
+ default:
+ /* HDTV 1920x1080p is confirmed OK on NV11 and higher cards */
- return NULL;
+ /* check if the requested buffer width is supported */
+ 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;
+ }
+ break;
}
/* store slopspace (in pixels) for each bitmap for use by 'overlay unit' (BES) */
diff --git a/src/add-ons/accelerants/nvidia/engine/nv_bes.c b/src/add-ons/accelerants/nvidia/engine/nv_bes.c
index 7e8169561d..44c16a6d7e 100644
--- a/src/add-ons/accelerants/nvidia/engine/nv_bes.c
+++ b/src/add-ons/accelerants/nvidia/engine/nv_bes.c
@@ -1,5 +1,5 @@
/* Nvidia TNT and GeForce Back End Scaler functions */
-/* Written by Rudolf Cornelissen 05/2002-12/2005 */
+/* Written by Rudolf Cornelissen 05/2002-5/2009 */
#define MODULE_BIT 0x00000200
@@ -225,8 +225,8 @@ static void nv_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;
+ /* AND below required by hardware (> 1024 support confirmed on all cards) */
+ moi->hsrcstv &= 0x07fffffc;
LOG(4,("Overlay: first hor. (sub)pixel of input bitmap contributing %f\n", moi->hsrcstv / (float)65536));
diff --git a/src/add-ons/accelerants/nvidia/engine/nv_general.c b/src/add-ons/accelerants/nvidia/engine/nv_general.c
index 4766366066..296df34829 100644
--- a/src/add-ons/accelerants/nvidia/engine/nv_general.c
+++ b/src/add-ons/accelerants/nvidia/engine/nv_general.c
@@ -92,7 +92,7 @@ status_t nv_general_powerup()
{
status_t status;
- LOG(1,("POWERUP: Haiku nVidia Accelerant 0.87 running.\n"));
+ LOG(1,("POWERUP: Haiku nVidia Accelerant 0.88 running.\n"));
/* log VBLANK INT usability status */
if (si->ps.int_assigned)
diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html b/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
index 372294dddd..466f44fc5e 100644
--- a/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
+++ b/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
@@ -4,7 +4,7 @@
Changes done for each driverversion:
-head (SVN 0.87, Rudolf)
+head (SVN 0.88, Rudolf)
- Fixed driver assuming enabling AGP mode succeeded on some occasions if it did not block it itself. Blocking AGP mode completely via the AGP busmanager (option 'block_agp') resulted in a crashing acceleration engine because it was setup for AGP transfers instead of using PCI transfers. Error was solved with help from user kraton.
- Fixed shared_info struct problem occuring when 3D 'accelerant' is used (tested Alpha 4.1): the TVencoder type definition list apparantly gets some memory assigned these days when done inside the definition of shared_info. Moved encoder list outside the shared_info definition.
@@ -14,10 +14,10 @@
- 'pgm_panel' is now preset to 'false' since this will probably increase chances of a good picture on panels outthere.
- 'force_ws' is now (re-enabled but) preset to 'true' since the number of widescreen monitors outthere is rapidly becoming mainstream.
Note please:
'force_ws' was hardcoded to setting 'true' some time ago by the Haiku team because of these monitors.
+
Added 'block_acc' option in nvidia.settings to completely disable the acceleration engine. Use this as a work-around if the acceleration engine misbehaves.
Fixed card/system hanging after trying to log LVDS/TMDS distinction info. This (at least) fixes one NV34 trying to startup after a failed kernel VESA modeswitch without using the driver's coldstart option. Might very well help on other type cards too.
-
-
+HDTV video upto/including 1920x1080p can now be played back using overlay on Geforce cards where overlay is supported. On TNT1/TNT2/TNT2-M64 this can't be done and bitmap output is used.
nv_driver 0.80 (Rudolf)