Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 169388 | Differences between
and this patch

Collapse All | Expand All

(-)SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c (-6 / +1 lines)
Lines 27-43 Link Here
27
#include <stdio.h>
27
#include <stdio.h>
28
#include <fcntl.h>
28
#include <fcntl.h>
29
#include <unistd.h>
29
#include <unistd.h>
30
#include <sys/ioctl.h>
30
#include <sys/ioctl.h>
31
#include <sys/mman.h>
31
#include <sys/mman.h>
32
#include <asm/page.h>		/* For definition of PAGE_SIZE */
33
#include <linux/vt.h>
32
#include <linux/vt.h>
34
33
35
#ifndef PAGE_SIZE
36
# define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
37
#endif
38
39
#include "SDL_video.h"
34
#include "SDL_video.h"
40
#include "SDL_mouse.h"
35
#include "SDL_mouse.h"
41
#include "../SDL_sysvideo.h"
36
#include "../SDL_sysvideo.h"
42
#include "../SDL_pixels_c.h"
37
#include "../SDL_pixels_c.h"
43
#include "../../events/SDL_events_c.h"
38
#include "../../events/SDL_events_c.h"
Lines 549-559 Link Here
549
		}
544
		}
550
	}
545
	}
551
546
552
	/* Memory map the device, compensating for buggy PPC mmap() */
547
	/* Memory map the device, compensating for buggy PPC mmap() */
553
	mapped_offset = (((long)finfo.smem_start) -
548
	mapped_offset = (((long)finfo.smem_start) -
554
	                (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
549
	                (((long)finfo.smem_start)&~((int)sysconf(_SC_PAGE_SIZE)-1)));
555
	mapped_memlen = finfo.smem_len+mapped_offset;
550
	mapped_memlen = finfo.smem_len+mapped_offset;
556
	mapped_mem = do_mmap(NULL, mapped_memlen,
551
	mapped_mem = do_mmap(NULL, mapped_memlen,
557
	                  PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
552
	                  PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
558
	if ( mapped_mem == (char *)-1 ) {
553
	if ( mapped_mem == (char *)-1 ) {
559
		SDL_SetError("Unable to memory map the video hardware");
554
		SDL_SetError("Unable to memory map the video hardware");
(-)SDL-1.2.11.orig/src/video/ps2gs/SDL_gsyuv.c (-3 / +2 lines)
Lines 25-36 Link Here
25
25
26
#include <fcntl.h>
26
#include <fcntl.h>
27
#include <unistd.h>
27
#include <unistd.h>
28
#include <sys/ioctl.h>
28
#include <sys/ioctl.h>
29
#include <sys/mman.h>
29
#include <sys/mman.h>
30
#include <asm/page.h>		/* For definition of PAGE_SIZE */
30
/* There is no PAGE_SIZE define anymore, use sysconf from unistd.h instead */
31
32
#ifndef PAGE_SIZE
31
#ifndef PAGE_SIZE
33
# define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
32
# define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
34
#endif
33
#endif
35
34
36
#include "SDL_video.h"
35
#include "SDL_video.h"
Lines 182-192 Link Here
182
		return(NULL);
181
		return(NULL);
183
	}
182
	}
184
183
185
	/* Allocate a DMA area for pixel conversion */
184
	/* Allocate a DMA area for pixel conversion */
186
	bpp = this->screen->format->BytesPerPixel;
185
	bpp = this->screen->format->BytesPerPixel;
187
	map_offset = (mapped_len + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
186
	map_offset = (mapped_len + ((int)sysconf(_SC_PAGE_SIZE) - 1)) & ~((int)sysconf(_SC_PAGE_SIZE) - 1);
188
	hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) +
187
	hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) +
189
	                  width * height * bpp +
188
	                  width * height * bpp +
190
	                  hwdata->macroblocks * (16 * sizeof(long long)) +
189
	                  hwdata->macroblocks * (16 * sizeof(long long)) +
191
	                  12 * sizeof(long long);
190
	                  12 * sizeof(long long);
192
	hwdata->dma_mem = mmap(0, hwdata->dma_len, PROT_READ|PROT_WRITE,
191
	hwdata->dma_mem = mmap(0, hwdata->dma_len, PROT_READ|PROT_WRITE,
(-)SDL-1.2.11.orig/src/video/Xext/Xxf86dga/XF86DGA.c (-5 lines)
Lines 16-26 Link Here
16
16
17
#if defined(linux)
17
#if defined(linux)
18
#define HAS_MMAP_ANON
18
#define HAS_MMAP_ANON
19
#include <sys/types.h>
19
#include <sys/types.h>
20
#include <sys/mman.h>
20
#include <sys/mman.h>
21
#include <asm/page.h>   /* PAGE_SIZE */
22
#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
21
#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
23
#define HAS_GETPAGESIZE
22
#define HAS_GETPAGESIZE
24
#endif /* linux */
23
#endif /* linux */
25
24
26
#if defined(CSRG_BASED)
25
#if defined(CSRG_BASED)
Lines 489-502 Link Here
489
#endif
488
#endif
490
#ifdef HAS_GETPAGESIZE
489
#ifdef HAS_GETPAGESIZE
491
    if (pagesize == -1)
490
    if (pagesize == -1)
492
	pagesize = getpagesize();
491
	pagesize = getpagesize();
493
#endif
492
#endif
494
#ifdef PAGE_SIZE
495
    if (pagesize == -1)
496
	pagesize = PAGE_SIZE;
497
#endif
498
    if (pagesize == -1)
493
    if (pagesize == -1)
499
	pagesize = 4096;
494
	pagesize = 4096;
500
495
501
   delta = address % pagesize;
496
   delta = address % pagesize;
502
   offset = address - delta;
497
   offset = address - delta;

Return to bug 169388