src/scripts/clock-graph.5c | 174 --------------------------------------------- src/scripts/clock.5c | 40 ---------- src/scripts/fix.5c | 14 --- src/scripts/tv.5c | 128 --------------------------------- src/sna/brw/brw_eu_debug.c | 95 ------------------------ src/sna/brw/brw_eu_util.c | 126 -------------------------------- 6 files changed, 577 deletions(-)
New commits: commit 99f67a2fe7e1ef3eefff56880f9eedde89d29bb4 Author: Timo Aaltonen <tjaal...@ubuntu.com> Date: Fri Oct 18 09:37:16 2013 +0300 clean crap from the branch to make reviewing more pleasant diff --git a/src/scripts/clock-graph.5c b/src/scripts/clock-graph.5c deleted file mode 100644 index 324febf..0000000 --- a/src/scripts/clock-graph.5c +++ /dev/null @@ -1,174 +0,0 @@ -autoload Cairo; -import Cairo; -library "examples/sort.5c"; -import Sort; - -int width = 1000, height = 200; -int min_vco = 1400000000; -int max_vco = 2800000000; -int min = 0xffffffff; -int max = 0; - -int max_clocks = 2000; -int[4][max_clocks] clocks; -int[4][max_clocks] vcos; -int[4] clock_count = {0...}; - -int[4] p2vals = {5,10,7,14}; - -cairo_t cr = Cairo::new(width, height); - -void calc_p2(int p2i) -{ - int p2 = p2vals[p2i]; - int min_p, max_p; - - clocks[p2i] = (int [max_clocks]){0...}; - - if (p2 == 7 || p2 == 14) { - /* LVDS */ - min_p = 7; - max_p = 98; - } else { - /* SDVO/DAC */ - min_p = 5; - max_p = 80; - } - - for (int m1 = 10; m1 <= 22; m1++) { - for (int m2 = 5; m2 <= 9; m2++) { - for (int n = 1; n <= 5; n++) { - for (int p1 = 1; p1 <= 8; p1++) { - int ref = 96000000; - int m = 5 * (m1 + 2) + (m2 + 2); - int p = p1 * p2; - int vco = floor(ref * m / (n + 2)); - int clock = floor(vco / p); - - if (p < min_p || p > max_p) - continue; - if (m < 70 || m > 120) - continue; - if (m2 > m1) - continue; /* won't happen */ - if (vco < min_vco || vco > max_vco) - continue; - -/* - printf("clock: %d (%d,%d), %d, " - "(%d,%d)\n", - floor(clock / 1000), - m1, m2, n, p1, p2); -*/ - - clocks[p2i][clock_count[p2i]] = clock; - vcos[p2i][clock_count[p2i]] = vco; - clock_count[p2i]++; - } - } - } - } -} - -bool sort_p2(poly a, poly b) -{ - return a > b; -} - -int min_rate = 25000 * 1000; -int max_rate = 200000 * 1000; - -real scale_x(real clock) -{ - int min_x = 75, max_x = width - 50; - - real frac = (clock - min_rate) / (max_rate - min_rate); - - return min_x + frac * (max_x - min_x); -} - -for (p2i = 0; p2i < dim(p2vals); p2i++) { - int p2 = p2vals[p2i]; - calc_p2(p2i); - real row_y1 = (p2i + 1) / (dim(p2vals) + 1) * height; - real row_y2 = p2i / (dim(p2vals) + 1) * height; - - /*qsort(&p2vals[p2i], sort_p2);*/ - - switch (p2) { - case 5: - set_source_rgb(cr, 1,0,0); - break; - case 10: - set_source_rgb(cr, 0,1,0); - break; - case 7: - set_source_rgb(cr, 0,0,1); - break; - case 14: - set_source_rgb(cr, 0,0,0); - break; - } - - /* draw the line for the clock */ - for (int i = 0; i < clock_count[p2i]; i++) { - int clock = clocks[p2i][i]; - real xpos; - - if (clock < min_rate || clock > max_rate) - continue; - - xpos = scale_x(clock); - move_to(cr, xpos, row_y1); - line_to(cr, xpos, row_y2); - stroke(cr); - } - - set_source_rgb(cr, 1, 1, 1); - /* add a mark for the vco value of the clocks at each location */ - for (int i = 0; i < clock_count[p2i]; i++) { - int clock = clocks[p2i][i]; - int vco = vcos[p2i][i]; - real mark_center; - - if (clock < min_rate || clock > max_rate) - continue; - - real xpos = scale_x(clock); - real vcofrac = (vco - min_vco) / (max_vco - min_vco); - real mark_height = (row_y1 + vcofrac * (row_y2 - row_y1)); - - move_to(cr, xpos, mark_height - 1); - line_to(cr, xpos, mark_height + 1); - stroke(cr); - } - - set_source_rgb(cr, 0, 0, 0); - string p2label = sprintf("p2 = %d", p2); - move_to(cr, 5, (p2i + .5) / (dim(p2vals) + 1) * height + 4); - show_text(cr, p2label); -} - -void label_clock(real clock) { - real center_x = scale_x(clock); - string label = sprintf("%d", floor((clock + 500) / 1000000)); - text_extents_t e = text_extents(cr, label); - real left_x = center_x - e.x_advance / 2; - save(cr); - move_to(cr, left_x, height - 20); - show_text(cr, label); - restore(cr); -} - -label_clock(min_rate); -label_clock(max_rate); -label_clock(140 * 1000 * 1000); -label_clock(115 * 1000 * 1000); -label_clock(100 * 1000 * 1000); -label_clock(82 * 1000 * 1000); - -string xlabel = "Clock in Mhz"; -text_extents_t e = text_extents(cr, xlabel); -move_to(cr, width / 2 - e.x_advance / 2, height - 5); -show_text(cr, xlabel); -sleep(10); diff --git a/src/scripts/clock.5c b/src/scripts/clock.5c deleted file mode 100644 index c83c689..0000000 --- a/src/scripts/clock.5c +++ /dev/null @@ -1,40 +0,0 @@ -int p2 = 14; -int min_p, max_p; - -if (p2 == 7 || p2 == 14) { - /* LVDS */ - min_p = 7; - max_p = 98; -} else { - /* SDVO/DAC */ - min_p = 5; - max_p = 80; -} - -for (int m1 = 10; m1 <= 22; m1++) { - for (int m2 = 5; m2 <= 9; m2++) { - for (int n = 1; n <= 6; n++) { - for (int p1 = 1; p1 <= 8; p1++) { - int ref = 96000000; - int m = 5 * (m1 + 2) + (m2 + 2); - int p = p1 * p2; - int vco = floor(ref * m / (n + 2)); - int clock = floor(vco / p); - - if (p < min_p || p > max_p) - continue; - if (m < 70 || m > 120) - continue; - if (m2 > m1) - continue; /* won't happen */ - if (vco < 1400000000 || - vco > 2800000000) - continue; - - printf("clock: %d (%d,%d),%d,(%d,%d)\n", - floor(clock / 1000), - m1, m2, n, p1, p2); - } - } - } -} diff --git a/src/scripts/fix.5c b/src/scripts/fix.5c deleted file mode 100644 index b758a43..0000000 --- a/src/scripts/fix.5c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Convert CSC fix point values to floats - */ - -real fixval (int fix) -{ - int exp = fix >> 9; - int mant = fix & ((1 << 9) - 1); - real ret; - if (exp == 0x7) - return 1.0; - ret = (2 ** -exp) * mant / (1 << 9); - return ret; -} diff --git a/src/scripts/tv.5c b/src/scripts/tv.5c deleted file mode 100644 index b4a2ba6..0000000 --- a/src/scripts/tv.5c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * tv.5c - * - * Compute tv encoder subcarrier dda constants - * - * The TV encoder subcarrier must be set precisely to the - * required frequency or the cumulative phase errors will be - * quite visible in the output. To accomplish this, the TV encoder - * has a complex circuit that takes a fixed clock, generated by the PLL - * and generates a precise subcarrier clock from that using the following - * formula: - * - * subcarrier = pixel_clock * (S1 + (S2 + (S3/Z3)) / Z2) / 4096 - * - * Careful selection of the constants will provide the necessarily - * precise clock. - * - * In the code below, S1 is represented by dda1, S2/Z2 by dda2 and S3/Z3 - * by dda3. - */ - -typedef struct { - int step; - int size; -} term_t; - -/* - * Find the approximation closest, but no larger than 'v', where - * 0 <= v < 1, and the result denominator must be less than 30000. - */ -term_t approx (rational v) -{ - rational best_dist = 1.0; - term_t best; - - for (int den = 20000; den < 30000; den++) - { - int num = floor (v * den); - term_t approx = { step = num, size = den }; - rational dist = v - approx.step/approx.size; - if (dist >= 0 && dist < best_dist) - { - best_dist = dist; - best = approx; - } - } - return best; -} - -typedef struct { - rational subcarrier; - rational pixel; - rational result; - term_t dda1; - term_t dda2; - term_t dda3; -} dda; - -/* - * Compute the dda constants for the given pixel clock and - * desired subcarrier frequency - */ - -dda find_dda (rational pixel, rational subcarrier) -{ - dda d; - - d.subcarrier = subcarrier; - d.pixel = pixel; - - rational dda1 = subcarrier / pixel * 4096; - d.dda1 = (term_t) { step = floor (dda1), size = 4096 }; - - rational dda2 = dda1 - d.dda1.step; - d.dda2 = approx (dda2); - - rational dda3 = dda2 * d.dda2.size - d.dda2.step; - d.dda3 = approx (dda3); - - /* Compute the resulting pixel clock to compare */ - d.result = d.pixel * (d.dda1.step + - (d.dda2.step + d.dda3.step/d.dda3.size) / - d.dda2.size) / d.dda1.size; - return d; -} - -/* - * Print out the computed constants - */ -void print_dda (dda d) -{ - printf ("\t/* desired %9.7f actual %9.7f clock %g */\n", - d.subcarrier, d.result, d.pixel); - printf ("\t.dda1_inc\t= %6d,\n", d.dda1.step); - printf ("\t.dda2_inc\t= %6d,\t.dda2_size\t= %6d,\n", - d.dda2.step, d.dda2.step != 0 ? d.dda2.size : 0); - printf ("\t.dda3_inc\t= %6d,\t.dda3_size\t= %6d,\n", - d.dda3.step, d.dda3.step != 0 ? d.dda3.size : 0); -} - -/* - * These are all of the required subcarrier frequencies - */ -rational[] subcarriers = { - /* these are the values we use; for some reason, this generates - * a more stable image (at least for NTSC) */ - 3.580, 4.434, 3.582, 3.576, 4.430, - - /* these are the values pulled out of the various specs */ - 3.579545, 4.433618, 3.582056, 3.575611, 4.433618 -}; - -/* - * We fix the pixel clock to a value which the hardware can - * generate exactly - */ -rational pixel = 107.520; - -void main () -{ - for (int i = 0; i < dim(subcarriers); i++) - { - dda d = find_dda (pixel, subcarriers[i]); - print_dda (d); - } -} - -main (); diff --git a/src/sna/brw/brw_eu_debug.c b/src/sna/brw/brw_eu_debug.c deleted file mode 100644 index 99453af..0000000 --- a/src/sna/brw/brw_eu_debug.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) Intel Corp. 2006. All Rights Reserved. - Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to - develop this 3D driver. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice (including the - next paragraph) shall be included in all copies or substantial - portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - **********************************************************************/ - /* - * Authors: - * Keith Whitwell <ke...@tungstengraphics.com> - */ - - -#include "main/mtypes.h" -#include "main/imports.h" -#include "brw_eu.h" - -void brw_print_reg( struct brw_reg hwreg ) -{ - static const char *file[] = { - "arf", - "grf", - "msg", - "imm" - }; - - static const char *type[] = { - "ud", - "d", - "uw", - "w", - "ub", - "vf", - "hf", - "f" - }; - - printf("%s%s", - hwreg.abs ? "abs/" : "", - hwreg.negate ? "-" : ""); - - if (hwreg.file == BRW_GENERAL_REGISTER_FILE && - hwreg.nr % 2 == 0 && - hwreg.subnr == 0 && - hwreg.vstride == BRW_VERTICAL_STRIDE_8 && - hwreg.width == BRW_WIDTH_8 && - hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 && - hwreg.type == BRW_REGISTER_TYPE_F) { - /* vector register */ - printf("vec%d", hwreg.nr); - } - else if (hwreg.file == BRW_GENERAL_REGISTER_FILE && - hwreg.vstride == BRW_VERTICAL_STRIDE_0 && - hwreg.width == BRW_WIDTH_1 && - hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 && - hwreg.type == BRW_REGISTER_TYPE_F) { - /* "scalar" register */ - printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); - } - else if (hwreg.file == BRW_IMMEDIATE_VALUE) { - printf("imm %f", hwreg.dw1.f); - } - else { - printf("%s%d.%d<%d;%d,%d>:%s", - file[hwreg.file], - hwreg.nr, - hwreg.subnr / type_sz(hwreg.type), - hwreg.vstride ? (1<<(hwreg.vstride-1)) : 0, - 1<<hwreg.width, - hwreg.hstride ? (1<<(hwreg.hstride-1)) : 0, - type[hwreg.type]); - } -} - - - diff --git a/src/sna/brw/brw_eu_util.c b/src/sna/brw/brw_eu_util.c deleted file mode 100644 index 5405cf1..0000000 --- a/src/sna/brw/brw_eu_util.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) Intel Corp. 2006. All Rights Reserved. - Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to - develop this 3D driver. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice (including the - next paragraph) shall be included in all copies or substantial - portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - **********************************************************************/ - /* - * Authors: - * Keith Whitwell <ke...@tungstengraphics.com> - */ - - -#include "brw_context.h" -#include "brw_defines.h" -#include "brw_eu.h" - - -void brw_math_invert( struct brw_compile *p, - struct brw_reg dst, - struct brw_reg src) -{ - brw_math( p, - dst, - BRW_MATH_FUNCTION_INV, - BRW_MATH_SATURATE_NONE, - 0, - src, - BRW_MATH_PRECISION_FULL, - BRW_MATH_DATA_VECTOR ); -} - - - -void brw_copy4(struct brw_compile *p, - struct brw_reg dst, - struct brw_reg src, - GLuint count) -{ - GLuint i; - - dst = vec4(dst); - src = vec4(src); - - for (i = 0; i < count; i++) - { - GLuint delta = i*32; - brw_MOV(p, byte_offset(dst, delta), byte_offset(src, delta)); - brw_MOV(p, byte_offset(dst, delta+16), byte_offset(src, delta+16)); - } -} - - -void brw_copy8(struct brw_compile *p, - struct brw_reg dst, - struct brw_reg src, - GLuint count) -{ - GLuint i; - - dst = vec8(dst); - src = vec8(src); - - for (i = 0; i < count; i++) - { - GLuint delta = i*32; - brw_MOV(p, byte_offset(dst, delta), byte_offset(src, delta)); - } -} - - -void brw_copy_indirect_to_indirect(struct brw_compile *p, - struct brw_indirect dst_ptr, - struct brw_indirect src_ptr, - GLuint count) -{ - GLuint i; - - for (i = 0; i < count; i++) - { - GLuint delta = i*32; - brw_MOV(p, deref_4f(dst_ptr, delta), deref_4f(src_ptr, delta)); - brw_MOV(p, deref_4f(dst_ptr, delta+16), deref_4f(src_ptr, delta+16)); - } -} - - -void brw_copy_from_indirect(struct brw_compile *p, - struct brw_reg dst, - struct brw_indirect ptr, - GLuint count) -{ - GLuint i; - - dst = vec4(dst); - - for (i = 0; i < count; i++) - { - GLuint delta = i*32; - brw_MOV(p, byte_offset(dst, delta), deref_4f(ptr, delta)); - brw_MOV(p, byte_offset(dst, delta+16), deref_4f(ptr, delta+16)); - } -} - - - - -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1vx5sd-0008ne...@vasks.debian.org