frontend: add 2x scaling option
authornotaz <notasas@gmail.com>
Wed, 24 Dec 2014 22:35:21 +0000 (00:35 +0200)
committernotaz <notasas@gmail.com>
Wed, 24 Dec 2014 22:35:21 +0000 (00:35 +0200)
frontend/menu.c
frontend/menu.h
frontend/plat_omap.c
frontend/plugin_lib.c

index 2823a23..a37ab05 100644 (file)
@@ -391,7 +391,7 @@ static const struct {
        CE_CONFIG_VAL(VSyncWA),
        CE_CONFIG_VAL(Cpu),
        CE_INTVAL(region),
        CE_CONFIG_VAL(VSyncWA),
        CE_CONFIG_VAL(Cpu),
        CE_INTVAL(region),
-       CE_INTVAL_V(g_scaler, 2),
+       CE_INTVAL_V(g_scaler, 3),
        CE_INTVAL(g_gamma),
        CE_INTVAL(g_layer_x),
        CE_INTVAL(g_layer_y),
        CE_INTVAL(g_gamma),
        CE_INTVAL(g_layer_x),
        CE_INTVAL(g_layer_y),
@@ -1194,13 +1194,17 @@ static int menu_loop_keyconfig(int id, int keys)
 
 // ------------ gfx options menu ------------
 
 
 // ------------ gfx options menu ------------
 
-static const char *men_scaler[] = { "1x1", "scaled 4:3", "integer scaled 4:3", "fullscreen", "custom", NULL };
+static const char *men_scaler[] = {
+       "1x1", "integer scaled 2x", "scaled 4:3", "integer scaled 4:3", "fullscreen", "custom", NULL
+};
 static const char *men_soft_filter[] = { "None",
 #ifdef __ARM_NEON__
        "scale2x", "eagle2x",
 #endif
        NULL };
 static const char *men_dummy[] = { NULL };
 static const char *men_soft_filter[] = { "None",
 #ifdef __ARM_NEON__
        "scale2x", "eagle2x",
 #endif
        NULL };
 static const char *men_dummy[] = { NULL };
+static const char h_scaler[]    = "int. 2x  - scales w. or h. 2x if it fits on screen\n"
+                                 "int. 4:3 - uses integer if possible, else fractional";
 static const char h_cscaler[]   = "Displays the scaler layer, you can resize it\n"
                                  "using d-pad or move it using R+d-pad";
 static const char h_overlay[]   = "Overlay provides hardware accelerated scaling";
 static const char h_cscaler[]   = "Displays the scaler layer, you can resize it\n"
                                  "using d-pad or move it using R+d-pad";
 static const char h_overlay[]   = "Overlay provides hardware accelerated scaling";
@@ -1261,7 +1265,7 @@ static int menu_loop_cscaler(int id, int keys)
 
 static menu_entry e_menu_gfx_options[] =
 {
 
 static menu_entry e_menu_gfx_options[] =
 {
-       mee_enum      ("Scaler",                   MA_OPT_VARSCALER, g_scaler, men_scaler),
+       mee_enum_h    ("Scaler",                   MA_OPT_VARSCALER, g_scaler, men_scaler, h_scaler),
        mee_enum      ("Video output mode",        MA_OPT_VOUT_MODE, plat_target.vout_method, men_dummy),
        mee_onoff     ("Software Scaling",         MA_OPT_SCALER2, soft_scaling, 1),
        mee_enum      ("Hardware Filter",          MA_OPT_HWFILTER, plat_target.hwfilter, men_dummy),
        mee_enum      ("Video output mode",        MA_OPT_VOUT_MODE, plat_target.vout_method, men_dummy),
        mee_onoff     ("Software Scaling",         MA_OPT_SCALER2, soft_scaling, 1),
        mee_enum      ("Hardware Filter",          MA_OPT_HWFILTER, plat_target.hwfilter, men_dummy),
index 0d68469..6b1e55f 100644 (file)
@@ -15,6 +15,7 @@ enum g_opts_opts {
 
 enum g_scaler_opts {
        SCALE_1_1,
 
 enum g_scaler_opts {
        SCALE_1_1,
+       SCALE_2_2,
        SCALE_4_3,
        SCALE_4_3v2,
        SCALE_FULLSCREEN,
        SCALE_4_3,
        SCALE_4_3v2,
        SCALE_FULLSCREEN,
index 6126140..f397cc6 100644 (file)
@@ -99,7 +99,7 @@ void *plat_gvideo_set_mode(int *w, int *h, int *bpp)
        int l = 0, r = 0, t = 0, b = 0;
        void *buf;
 
        int l = 0, r = 0, t = 0, b = 0;
        void *buf;
 
-       if (g_scaler == SCALE_1_1) {
+       if (g_scaler == SCALE_1_1 || g_scaler == SCALE_2_2) {
                if (*w > g_menuscreen_w)
                        l = r = (*w - g_menuscreen_w) / 2;
                if (*h > g_menuscreen_h)
                if (*w > g_menuscreen_w)
                        l = r = (*w - g_menuscreen_w) / 2;
                if (*h > g_menuscreen_h)
index 72b3395..64f96a0 100644 (file)
@@ -180,6 +180,14 @@ static void update_layer_size(int w, int h)
                g_layer_w = w; g_layer_h = h;
                break;
 
                g_layer_w = w; g_layer_h = h;
                break;
 
+       case SCALE_2_2:
+               g_layer_w = w; g_layer_h = h;
+               if (w * 2 <= g_menuscreen_w)
+                       g_layer_w = w * 2;
+               if (h * 2 <= g_menuscreen_h)
+                       g_layer_h = h * 2;
+               break;
+
        case SCALE_4_3v2:
                if (h > g_menuscreen_h || (240 < h && h <= 360))
                        goto fractional_4_3;
        case SCALE_4_3v2:
                if (h > g_menuscreen_h || (240 < h && h <= 360))
                        goto fractional_4_3;