Re: [PATCH:xf86-video-s3virge 2/2] Add cast to remove a warning on 32-bit machines.
On Mon, 2015-09-28 at 22:49 +0200, Thomas Klausner wrote: > PCI_REGION_BASE returns a 64-bit value, which needs to be converted > down to 32-bit before it can be put into a 32-bit pointer. Ugh, DGA sure is awful. The problem here is if the fb bar really is above 4G this is going to return garbage to the client; but that's not really different from what happens anyway (since the dispatch code never fills in mem2 on 32-bit-pointer machines), so I guess the patch isn't wrong so much as not a real improvement. The OpenFramebuffer interface here is just wrong, the driver ought to return a u64 and the server should copy that into the reply properly. I'm in no hurry to "fix" DGA so I've gone ahead and applied these two patches. remote: I: patch #60569 updated using rev 9c8a08c9c7a0f7ec591042abd5b4a0fb50c028f1. remote: I: patch #60568 updated using rev 47f43694645f3e6347b536d5e3fb2fee56e715ab. remote: I: 2 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/driver/xf86-video-s3virge 8a54ff3..47f4369 master -> master - ajax ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xf86-video-s3virge 2/2] Add cast to remove a warning on 32-bit machines.
PCI_REGION_BASE returns a 64-bit value, which needs to be converted down to 32-bit before it can be put into a 32-bit pointer. --- src/s3v_dga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s3v_dga.c b/src/s3v_dga.c index 0e603cf..0ab374d 100644 --- a/src/s3v_dga.c +++ b/src/s3v_dga.c @@ -337,7 +337,7 @@ S3V_OpenFramebuffer( S3VPtr ps3v = S3VPTR(pScrn); *name = NULL; /* no special device */ -*mem = (unsigned char*)PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM); +*mem = (unsigned char*)(uintptr_t)PCI_REGION_BASE(ps3v->PciInfo, 0, REGION_MEM); *size = ps3v->videoRambytes; *offset = 0; *flags = DGA_NEED_ROOT; -- 2.5.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel