mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
add pitch support and use new Width
This commit is contained in:
parent
a951c80ae4
commit
5bb5a1908f
1 changed files with 19 additions and 2 deletions
|
|
@ -48,6 +48,14 @@
|
||||||
static size_t drm_page_size;
|
static size_t drm_page_size;
|
||||||
#define xf86DrvMsg(...) do {} while(0)
|
#define xf86DrvMsg(...) do {} while(0)
|
||||||
|
|
||||||
|
static const int pitches[] = {
|
||||||
|
128 * 8,
|
||||||
|
128 * 16,
|
||||||
|
128 * 32,
|
||||||
|
128 * 64,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea);
|
static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea);
|
||||||
|
|
||||||
static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830)
|
static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830)
|
||||||
|
|
@ -664,7 +672,6 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830)
|
||||||
drmI830Sarea *pSAREAPriv;
|
drmI830Sarea *pSAREAPriv;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
|
||||||
drm_page_size = getpagesize();
|
drm_page_size = getpagesize();
|
||||||
|
|
||||||
pI830->registerSize = ctx->MMIOSize;
|
pI830->registerSize = ctx->MMIOSize;
|
||||||
|
|
@ -675,7 +682,7 @@ I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830)
|
||||||
*/
|
*/
|
||||||
ctx->shared.SAREASize = SAREA_MAX;
|
ctx->shared.SAREASize = SAREA_MAX;
|
||||||
|
|
||||||
/* Note that drmOpen will try to load the kernel module, if needed. */
|
/* Note that drmOpen will try to load the kernel module, if needed. */
|
||||||
ctx->drmFD = drmOpen("i915", NULL );
|
ctx->drmFD = drmOpen("i915", NULL );
|
||||||
if (ctx->drmFD < 0) {
|
if (ctx->drmFD < 0) {
|
||||||
fprintf(stderr, "[drm] drmOpen failed\n");
|
fprintf(stderr, "[drm] drmOpen failed\n");
|
||||||
|
|
@ -873,6 +880,7 @@ static int i830PostValidateMode( const DRIDriverContext *ctx )
|
||||||
static int i830InitFBDev( DRIDriverContext *ctx )
|
static int i830InitFBDev( DRIDriverContext *ctx )
|
||||||
{
|
{
|
||||||
I830Rec *pI830 = calloc(1, sizeof(I830Rec));
|
I830Rec *pI830 = calloc(1, sizeof(I830Rec));
|
||||||
|
int i;
|
||||||
|
|
||||||
{
|
{
|
||||||
int dummy = ctx->shared.virtualWidth;
|
int dummy = ctx->shared.virtualWidth;
|
||||||
|
|
@ -885,6 +893,15 @@ static int i830InitFBDev( DRIDriverContext *ctx )
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->shared.virtualWidth = dummy;
|
ctx->shared.virtualWidth = dummy;
|
||||||
|
ctx->shared.Width = ctx->shared.virtualWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (i = 0; pitches[i] != 0; i++) {
|
||||||
|
if (pitches[i] >= ctx->shared.virtualWidth) {
|
||||||
|
ctx->shared.virtualWidth = pitches[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->driverPrivate = (void *)pI830;
|
ctx->driverPrivate = (void *)pI830;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue