Francisco Jerez
2009-Oct-11 18:52 UTC
[Nouveau] [PATCH 1/2] Fix NVLoadPalette for 15/16 bit depth.
Signed-off-by: Francisco Jerez <currojerez at riseup.net> --- src/nv_driver.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/nv_driver.c b/src/nv_driver.c index a31ce5d..4255c19 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1419,6 +1419,8 @@ NVLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, lut_b[index * 8 + j] = colors[index].blue << 8; } } + break; + case 16: for (i = 0; i < numColors; i++) { index = indices[i]; @@ -1434,6 +1436,8 @@ NVLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, lut_g[index * 4 + j] = colors[index].green << 8; } } + break; + default: for (i = 0; i < numColors; i++) { index = indices[i]; -- 1.6.4.4
Francisco Jerez
2009-Oct-11 18:52 UTC
[Nouveau] [PATCH 2/2] Revert "kms: always set gamma on modeset"
This reverts commit 6c8d3e39b72abe897b08d9e90cae85e121863d2c, as it breaks gamma setting with servers older than 1.7. Signed-off-by: Francisco Jerez <currojerez at riseup.net> --- It looks like it was intended to workaround the problem in NVLoadPalette PATCH1 fixes. src/drmmode_display.c | 7 +++++-- src/nv_driver.c | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 3930814..43aca64 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -346,8 +346,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, } #if XF86_CRTC_VERSION >= 3 - crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, - crtc->gamma_blue, crtc->gamma_size); + /* Only upload when needed, to avoid unneeded delays. */ + if (!crtc->active) + crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, + crtc->gamma_blue, crtc->gamma_size); + crtc->active = TRUE; #endif diff --git a/src/nv_driver.c b/src/nv_driver.c index 4255c19..4595940 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1690,8 +1690,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * Initialize colormap layer. * Must follow initialization of the default colormap */ - if (!pNv->kms_enable && - !xf86HandleColormaps(pScreen, 256, 8, NVLoadPalette, + if (!xf86HandleColormaps(pScreen, 256, 8, NVLoadPalette, NULL, CMAP_PALETTED_TRUECOLOR)) return FALSE; -- 1.6.4.4