From owner-freebsd-multimedia Sat Nov 8 13:10:39 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id NAA23925 for multimedia-outgoing; Sat, 8 Nov 1997 13:10:39 -0800 (PST) (envelope-from owner-freebsd-multimedia) Received: from whqvax.picker.com (whqvax.picker.com [144.54.1.1]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id NAA23919 for ; Sat, 8 Nov 1997 13:10:26 -0800 (PST) (envelope-from rhh@ct.picker.com) Received: from ct.picker.com by whqvax.picker.com with SMTP; Sat, 8 Nov 1997 16:08:06 -0500 (EST) Received: from elmer.ct.picker.com by ct.picker.com (4.1/SMI-4.1) id AA08362; Sat, 8 Nov 97 16:08:03 EST Received: by elmer.ct.picker.com (SMI-8.6/SMI-SVR4) id QAA15381; Sat, 8 Nov 1997 16:07:37 -0500 Message-Id: <19971108160737.19314@ct.picker.com> Date: Sat, 8 Nov 1997 16:07:37 -0500 From: Randall Hopper To: Eivind Eklund , Tomi Vainio , Joao Carlos Mendes Luis Cc: Amancio Hasty , freebsd-multimedia@FreeBSD.ORG Subject: bt/fxtv 24bpp & img cnvt patches (was Re: Bt848 driver patches) References: <199710291417.PAA01941@bitbox.follo.net> <199710301744.JAA09896@rah.star-gate.com> <19971030194225.11523@bitbox.follo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=Dxnq1zWXvFF0Q93v X-Mailer: Mutt 0.81 Content-Disposition: attachment; filename=mutta006gA In-Reply-To: <19971030194225.11523@bitbox.follo.net>; from Eivind Eklund on Thu, Oct 30, 1997 at 07:42:25PM +0100 Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Eivind Eklund: |(1) A single steady vertical line when the fxtv window is in some |position in the upper and lower right corner of my screen |(1600x1200x16 bit) - the rest of the window work normally. This one |seems likely to be a splitting problem, IFF the split is done as to |rectangles vertically. It seems to be related to the size of the |window; I've had some problems repeating it at will, but get it |from time to time. Two patches attached. Both will apply cleanly to the 971105 driver and Fxtv 0.46 (both on the Fxtv page). "bt848-24bpp-971108.patch" fixes: - The occasional vertical black line divider line in the video window (packed 24bpp direct video) - The occasional screwed up colors (packed 24bpp direct video) "fxtv-0.46-1-ximage.patch" fixes: - Bunch o' byte swapping and ximage pitch handling fixes (ALL bpp ximage modes). These should fix stairstep video, surreal color problems, as well as a few "unsupported color conversion" bail-outs people have seen. - Added 3Bpp->3/4Bpp conversion support, also fixes "unsup col conv" probs Please try em out and make sure they work as advertised on your box. Try all your server's color depths, and be sure to to do at least one freeze frame to verify that, not just direct video, but ximage transfer is working too. Let me know about any configurations that don't work for you. I'd like to wrap these up and get everybody supported without any patching needed. If you see a problem, the following info would be helpful: - Graphics card - X Server vendor (XFree,Xaccel) - X Server version (3.3.1) - X Server (SVGA,S3V,etc.) - Color depth (8,15,16,32) - "appres Fxtv" output - "fxtv -debug startup" output ----------- Driver Patch In case anybody's interested (or collecting tidbits for a Bt848 hackers guide), the "vertical black divider line" problem is due to the way the Bt848 processes a WRITE instruction. When it hits one of these, it resynchronizes Byte Lane 0 of the current FIFO dword to Byte 0 of the memory dword containing the starting transfer address ("not" the transfer address itself). So when a the driver's RISC program splits a scan line into 2 halves (two WRITEs), the second WRITE's resync causes a pixel to be dropped if it didn't occur in a "lucky" spot (see below). A WRITEC doesn't perform this alignment resync (the main reason for even having this instruction), so a WRITEC is now used for the last half of the scanline. And no more black line. Once I found this out, it was appearent why the colors in a packed 24bpp direct video window are whacked depending on where you put the window. In RGB24 mode, the pixels in each scan line roll off the Bt FIFO like this: BGRBGR... And in a packed-24bpp frame buffer that's Bt848 direct-video-compatible, the scan lines look like this: 0 1 2 3 4 5 6 7 BGRB GRBG RBGR BGRB GRBG RBGR ... Given the WRITE resync behavior described above, the FIFO components will align with the frame buffer if the starting transfer address is at pixel offsets 0,1,4,5,... (in general X % 4 == [0 or 1]), but they'll be out of sync for 2,3,6,7 (X % 4 == [2 or 3]). The solution here is to toss 1 or 2 DWORDs at the beginning of a scan line (SKIP) for the X%4=[2,3] cases to align the FIFO with the dword at the target memory address in the frame buffer. ----------- Fxtv Patch All these fixes relate to XImages transfer mode (which is used for freeze frame, when the window is partially occluded by other window(s), and when fxtv doesn't think the video card is compatible with direct video in a particular color depth). Byte order problems fixed. Use the byte order the server specifies for XImages, rather than erroneously using the frame buffer byte order (which must be specified by the user). Also do more intelligent swapping when converting between pixel geometries. Both these problems would have appeared before as surreal or reversed colors on the video frame. XImage pitch problem fixed. Sometimes (e.g. in 8bpp) there will need to be pad bytes allotted at the end of scan lines -- these weren't being put in before, potentially causing diagonal video frames for some video widths. Finally, added support for 3Bpp->3/4Bpp conversion. With these changes, colors look correct for me on my STB Velocity 3D in all color depths for both direct video and ximages transfer for both the SVGA and S3V servers on XFree 3.3.1. Please test all permutations on your card and let me know! Randall --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="bt848-24bpp-971108.patch.gz" =1F=8B=08=08=8E=C2d4=00=03bt848-24bpp-971108.patch=00=BDVaO=DBH=10=FD=EC=FC= =8Aw:=1D=8D=938=C4N=02 =B9 HK{=E8hA4R=EFt:Y=1B{C,l=AFe=AF=1B=D0=B5=F7=DBov= =D7! =A4=D0~=B9=80=88=F1=CE=CC=CE=BCy;=FB=1C=C7=C1,=17=E2V=E6=9C=0Fz=03gx= =E8=BA=9D~;=B0>=F1=10=1F=C4g=A0=0F=F7=E0=C8=ED=1Du=87p=87=C3=C3Z=B3=D9=DCr!= =DB=8FL=1A=DB=01:Ce=EB=0E=8C=ED=C9 =1Cw=D8o=1D=A0=A9=BE=0689=A9=E1=99=CF=DB= =E8=0E=92'=99=C8Y=8C=90=07Q=C2d$=D2=16=C2=A8`=B3=98#=92X.x=FAl=90PD=E9=0D^= =9F^=F9=1F=CF?=BC=BB8+Z`i=88(EX=B2=D8=99G<=0E=11=B0L=969=A7=C8"}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&W= =A5=01UFZ`$=EC^ =86H=C1O=EA=F2=FEA=0D=85=02=85HH=0BQ<=19}=E6&=14=A0=9A=A3T= =CC=96`=D2=1AI=A5=19=93f,4=1A=FA=BDi=05=AAV=E8=8C=8B,=8Ed=DD=B6=DB:=E5=A9= =926=F4=CBf$=FCX i=EF=05)=E2#=F0=F6M=1B=A9=D0=D5=16=D4r=92=10=A7#=83=C4=1E= =8A=85=C8=0D=D0=B4r:yw=BD*=BF=00=C96=82=A9$i=CE=EF2N=FA=B8=A6=85=CB=7F=AF= =CD=01=D3=A1=0C=00=00 --Dxnq1zWXvFF0Q93v Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fxtv-0.46-1-ximage.patch.gz" H4sICCXBZDQAA2Z4dHYtMC40Ni0xLXhpbWFnZS5wYXRjaADtG2tz2kjyc/wren2VHDJgg8CY mNiJ7dhZ6hLbZUg2d9kUJaPBVhYQKwnHvoT/ft0zeoykkXg4V9m7YiplkOju6enp90zK5TJ4 d27fYWxcrmzXG9v9J90pg3P7DqAOemW/Ut3f3YPq8+d7G8ViMQRGuI7hCbgmVOv7dX1f9+Fe vYLyXqPUgCL+1Svw6tUGbMDfTDawxgxO3l91Lq56nfa/TgGqDfypuLMFSMlj+/BgT8G9tadD EyaG68L78077zfnpa7DGHrthjgueDd4tcxmMjL5juwBbOxvFgHbnt6NLvXCvQQEHfhweInca PIPKfYWPwUAD+A7w+0YRUkPgvHgRwxkMKhVN2yjGJ6nFJ6k2Fp8ECMcfsUkWYCyahzBUjNU5 YxAwpte1JLH8SRISW5SxCMdnLBsHAhzijfO/AaQANLYUA85s56vhmGCy/tBwDM+yx25ILAGL ypBP7NKx7gyPwZ3hWMb1kLkyZwpiXJmbjXppD4rNvWapWufqHIyJdd+7YfaofDgy3D8+VT/D AdyVD2/IRHr0qpUJq/uw18MpC0A3ygHwx/fd9ts3zPtguVNj2PlqTNwCdD+8bncu3x79swR3 JXjm4tvedfDFBa0VydsaoBaYls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