diff options
-rw-r--r-- | man/nouveau.man | 4 | ||||
-rw-r--r-- | src/nv_const.h | 6 | ||||
-rw-r--r-- | src/nv_output.c | 18 |
3 files changed, 19 insertions, 9 deletions
diff --git a/man/nouveau.man b/man/nouveau.man index 83d20ae..ffa74ab 100644 --- a/man/nouveau.man +++ b/man/nouveau.man @@ -112,6 +112,10 @@ Supported only on GeForce4 and newer chips, this option tells to the driver to scale lower resolutions up to the flat panel's native resolution. Default: on. .TP +.BI "Option \*qScalingMode\*q \*q" string \*q +Only for the randr-1.2 driver, this allows to set the DFP scaling mode. +The options are "fullscreen", "aspect", "noscale" and "panel". Default: "aspect". +.TP .BI "Option \*qRotate\*q \*qCW\*q" .TP .BI "Option \*qRotate\*q \*qCCW\*q" diff --git a/src/nv_const.h b/src/nv_const.h index 9198d83..0b1c774 100644 --- a/src/nv_const.h +++ b/src/nv_const.h @@ -19,10 +19,10 @@ typedef enum { OPTION_CRTC_NUMBER, OPTION_FP_SCALE, OPTION_FP_TWEAK, - OPTION_ACCELMETHOD, OPTION_CMDBUF_LOCATION, OPTION_CMDBUF_SIZE, - OPTION_RANDR12 + OPTION_RANDR12, + OPTION_SCALING_MODE } NVOpts; @@ -38,10 +38,10 @@ static const OptionInfoRec NVOptions[] = { //{ OPTION_CRTC_NUMBER, "CrtcNumber", OPTV_INTEGER, {0}, FALSE }, { OPTION_FP_SCALE, "FPScale", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FP_TWEAK, "FPTweak", OPTV_INTEGER, {0}, FALSE }, - { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE }, { OPTION_CMDBUF_LOCATION, "CBLocation", OPTV_STRING, {0}, FALSE }, { OPTION_CMDBUF_SIZE, "CBSize", OPTV_INTEGER, {0}, FALSE }, { OPTION_RANDR12, "Randr12", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_SCALING_MODE, "ScalingMode", OPTV_STRING, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; diff --git a/src/nv_output.c b/src/nv_output.c index 922d5f7..cb7e0dd 100644 --- a/src/nv_output.c +++ b/src/nv_output.c @@ -874,6 +874,8 @@ static char *scaling_mode_names[] = { }; static Atom scaling_mode_atom; +#define SCALING_MODE(_name) (nv_scaling_mode_lookup(_name, strlen(_name))) + static int nv_scaling_mode_lookup(char *name, int size) { @@ -1189,12 +1191,16 @@ static void nv_add_digital_output(ScrnInfoPtr pScrn, int dcb_entry, int lvds) nv_output->preferred_output = 0; } - if (pNv->fpScaler) { - /* Aspect ratio */ - nv_output->scaling_mode = 2; - } else { - /* "Panel mode" fully filled */ - nv_output->scaling_mode = 0; + if (pNv->fpScaler || lvds) { /* GPU Scaling */ + char *name = (char *)xf86GetOptValString(pNv->Options, OPTION_SCALING_MODE); + /* lvds must always use gpu scaling */ + if (name && (!lvds || (SCALING_MODE(name) != SCALING_MODE("panel")))) { + nv_output->scaling_mode = SCALING_MODE(name); + } else { + nv_output->scaling_mode = SCALING_MODE("aspect"); + } + } else { /* Panel scaling */ + nv_output->scaling_mode = SCALING_MODE("panel"); } output->possible_crtcs = pNv->dcb_table.entry[dcb_entry].heads; |