summaryrefslogtreecommitdiff
path: root/wiki/Chat_log/20170116-io-chatlog
blob: 3cf4ad2619a37dc1e174d2ac10d5c125d6431e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
--- Log opened Mon Jan 16 08:59:32 2017
08:59 -!- wsa_ [~wsa@p54B33FFD.dip0.t-ipconnect.de] has joined #periperi-io
08:59 -!- Irssi: #periperi-io: Total of 5 nicks [1 ops, 0 halfops, 0 voices, 4 normal]
08:59 -!- Irssi: Join to #periperi-io was synced in 1 secs
09:00 < wsa_> hey guys!
09:00 <@morimoto> hi
09:00 -!- shimoda [~shimoda@relprex3.renesas.com] has joined #periperi-io
09:00 < neg> horms: I accidently sent my ABC awnsers from my private email address to periperi, I have now resent the anwsers but feel free to delete and not to add my private email to the periperi whitelist :-)
09:00 -!- morimoto [~user@relprex3.renesas.com] has left #periperi-io ["ERC Version 5.3 (IRC client for Emacs)"]
09:00 < neg> wsa_: hi
09:00 < horms> neg: ok, will do
09:01 < neg> horms: thanks
09:01 -!- geertu [~geert@d54C189FD.access.telenet.be] has joined #periperi-io
09:01 < wsa_> that reminds me, simon you can remove the wsa-dev address from periperi as well
09:01 < geertu> Bummer, I was in #peripero-io
09:01 < horms> wsa_: sure
09:01 < wsa_> wsa@the-dreams.de seems to be back at full strength
09:02 < wsa_> geertu: "we are the popular front"
09:02 < wsa_> :D
09:03 -!- Irssi: #periperi-io: Total of 6 nicks [0 ops, 0 halfops, 0 voices, 6 normal]
09:04 < wsa_> ok, let's start
09:04 < wsa_> thanks for all the updates
09:04 < wsa_> despite holidays, there were some things going on :)
09:05 < wsa_> i have a few questions
09:05 < wsa_> first one about USB & IPMMU, I lost track a little of it
09:05 < wsa_> shimoda: does a workaround exist meanwhile?
09:06 < shimoda> wsa_: a workaround exist for some devices
09:07 < wsa_> and the SD workaround is basically the same issue
09:07 < wsa_> IPMMU issue
09:07 < wsa_> ?
09:08 < shimoda> wsa_: no. SDHI's restriction differs with IPMMU restriction...
09:09 < wsa_> OK, then I need to reread about that
09:10 < shimoda> wsa_: OK. But, I forgot that I wrote the SD restriction on periperi ML or not
09:10 < shimoda> so, i will summarize them later
09:10 < neg> is this be related to the IPMMU warnings seen on Gen2 while tuning SD or is it unrelated?
09:11 < wsa_> shimoda: thank you
09:11 < shimoda> neg: i'm not sure, but gen2 SYS-DMAC with IPMMU also has a problem
09:12 < geertu> There's also ipmmu-vmsa e67b0000.mmu: DMA-API: device driver tries to sync DMA memory it has not allocated
09:13 < neg> shimoda: ok thank you, I will read your upcoming summary on periperi and take it from there :-)
09:14 < wsa_> sounds good
09:14 < wsa_> i'm also looking forward to the desc :)
09:15 < wsa_> next question I have is about thermal driver testing
09:15 < wsa_> just so I know how to handle upstreaming
09:16 < wsa_> how likely is it that we can get Renesas testing from Gomi-san like this week or next week?
09:16 < shimoda> geertu: sorry I don't understand this "DMA-API" things
09:17 < geertu> shimoda: It means the ipmmu driver does something on a wrong pointer
09:17 < geertu> which may lead to corruption.
09:18 < wsa_> and would it be OK for Renesas if we upstream the driver without internal testing to get into v4.11 and fix issues (if any) with incremental patches?
09:18 < shimoda> wsa_: about thermel driver, Gomi-san and RVC are checking the v6 patch. and maybe i will get some feedack in this week .
09:18 < wsa_> \\o//
09:18 < wsa_> awesome!
09:19 < wsa_> still, the answer to the above question would be nice to know (to have a "Plan B")
09:21 < horms> wsa_: i would think the answer is yes unless there has been special requests made with regards to thermal from Renesas
09:22 < wsa_> there are no special requests
09:22 < shimoda> geertu: it's interesting. Is this easy to reproduce? 
09:23 < geertu> shimoda: Yes, it happens during ipmmu init. Just enable CONFIG_DMA_API_DEBUG=y
09:23 < wsa_> special is that we can do very limited testing on this one
09:23 < horms> wsa_: then I think you should do whatever is best from an upstream pov
09:24 < geertu> Sorry, during ravb_probe(), but I think it happens during init of the first user
09:24 < horms> wsa_: right, obviously we don't want things catching fire :)
09:24 < shimoda> geertu: thank you. i will try the config later
09:24  * wsa_ sings "relight my fire..."
09:25 < horms> haha: lets not have that be the theme for a patchset
09:25 < wsa_> :)
09:26 < wsa_> ok, so we'll try to get it into 4.11 anyhow, but hope that Gomi-san will be able to test this week
09:26 < wsa_> which would be awesome
09:28 < wsa_> is uli back from the holidays?
09:29 < wsa_> well, he has been on the multimedia meeting
09:29 < wsa_> would like to have had an update for his series -> will ask by mail
09:29 < wsa_> any questions from your side?
09:30 < horms> nothing in particular, other than that he should consider resending any outstanding patches
09:31 < neg> wsa_: you got time to talk about IO task after meeting?
09:32 < wsa_> yup
09:32 < wsa_> it's about emergency shutdown right?
09:33 < neg> yes
09:33 < horms> you probably know, but there is code in the BSP for that
09:33 < wsa_> well, there goes the last chance of really creating fire...
09:34 < neg> horms: I had a quick look at it, but I only found it by luck so thanks for pointing it out :-)
09:35 < horms> neg: any time
09:35 < wsa_> ok, if there are no other questions, let's talk about further hacking thermal/emergency
09:36 < wsa_> people not interested are free to leave, but everyone is welcome to stay, of course :)
09:36 < horms> i had one question, sorry
09:36 < wsa_> sure
09:36 < horms> meeting next month in .be
09:36 < horms> any firm plans?
09:37 < shimoda> about emergency shutdown, this is also handled by Gomi-san and/or related member. so, i can ask him about this
09:37 < wsa_> there will be an io meeting on friday
09:37 < wsa_> when exactly depends on when we have the room
09:37 < wsa_> geertu: ?
09:38 < horms> ok, do we have a location: I only ask so I can arrange some accomodation for myself
09:38 < geertu> horms: Yes, see "Meeting around FOSDEM"
09:39 < geertu> on periperi-ML
09:39 < horms> ok, thanks
09:39 < geertu> wsa_: I don't have hours, it's booked for the full day
09:39 < horms> I see it now
09:39 < neg> shimoda: thanks for telling me Gomi-san is working with emergency shutdown
09:40 < geertu> As I have to get their by train, I think I can be their at 9 or 9h30
09:40 < geertu> Of course you can start earlier ;-)
09:41 < geertu> s/be their/be there/
09:41 < wsa_> i don't think i can make it earlier than 9 as well
09:41 < horms> fwiw, i will likely arrive the day before
09:42 < wsa_> 9-13 first meeting, lunch, 14-18 second meeting ?
09:42 < geertu> Please reply to "Meeting around FOSDEM" to confirm your (un)attendence by Wednesday morning, thanks
09:42 < neg> I think 9:30 is a fine time, I need to navigate the local public transport system which if last year was any indication of my skill will take some time :-)
09:42 < geertu> BTW, Magnus just told me Ito-san may want to join the meetings
09:43 < wsa_> i'll be likely in brussels on thursday as well, but just "likely" yet...
09:43 < geertu> neg: I believe there's a direct subway from your hotel
09:43 < wsa_> neg: ok
09:43 < wsa_> 9:30-13:30 first meeting, lunch, 15-19 second meeting ?
09:44 < geertu> 13:30 may be a bit late for lunch
09:44 < neg> geertu: ahh thanks, will look it up
09:45 < wsa_> 9:30-13:00 first meeting, lunch, 14:30-18 second meeting, then open_end hacking ?
09:45 < geertu> What about 9:30-12:30 (I/O), 13:30-16:30 (Core), 16:30-18:00 (misc)
09:45 < wsa_> also fine
09:46 < wsa_> although, 1:30 for lunch might be more relaxing
09:46 < geertu> Note that we have to think about Dinner, and FOSDEM Beer Event starts at 16:00 :-)
09:47 < wsa_> even if it is lurking in the room for 30 minutes or having a short walk or something
09:48 < wsa_> can't tell that yet, i have not made all FOSDEM appointments
09:49 < wsa_> might be I'm busy on Friday evening meeting some ppl
09:49 < wsa_> hopefully not
09:49 < wsa_> :)
09:50 < wsa_> ok, back to thermal?
09:52 < wsa_> neg: fire away
09:52 < neg> So my question is more or less if you think "Thermal,?,noplan,?,add emergency shutdown support" could be a base or additonal task for me duing Q1 or if you rather see me working on something else. At the moment I have no IO tasks planed for Q1
09:53 < wsa_> i was rather thinking about "Thermal,?,noplan,?,add interrupt support" as your next task :)
09:54 < wsa_> which might be a prerequisite for shutdown anyhow
09:54 < wsa_> haven't checked
09:54 < neg> OK that also sounds like a suitable task for me
09:55 < wsa_> i have some drafts on my hdd somewhere, but it needs to be heavily refactored
09:55 < wsa_> if not redesigned
09:56 < wsa_> but at least we got the bindings in shape already
09:56 < wsa_> so we have freedom to redesign
09:57 < neg> OK that is fine, there is no rush we can hammer it out with email maybe before FOSDEM. My primary cencern where that there where some IO work for me to do :-)
09:57 < wsa_> interrupts were the reason why I went from three DT nodes to one and to introduce the #thermal-sensor-cells to be 1
09:58 < wsa_> you won't be bored with us
09:58 < wsa_> if all fails, there is SDHI ;)
09:59 < wsa_> but i think thermal might be your friend in the next time
10:00 < neg> nice :-) Then maybe you can send me the draft you made and think about if you wish me to do this as part of base or if we should try to get some of the work as an additinal contract and we take it from there?
10:00 < wsa_> exactly
10:01 < neg> thank you
10:03 < wsa_> i think we are done then
10:03 < wsa_> thank you all!
10:03 < wsa_> have a great week
10:03 < neg> I have nothing more, thanks all
10:04 < shimoda> thank you!
10:05 < geertu> thx
10:10 -!- shimoda [~shimoda@relprex3.renesas.com] has quit Quit: WeeChat 0.4.2
--- Log closed Mon Jan 16 10:16:36 2017
0'>480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634
/**************************************************************************
 * 
 * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
 * All Rights Reserved.
 * 
 * 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, sub license, 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 NON-INFRINGEMENT.
 * IN NO EVENT SHALL TUNGSTEN GRAPHICS 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.
 * 
 **************************************************************************/

/* Originally a fake version of the buffer manager so that we can
 * prototype the changes in a driver fairly quickly, has been fleshed
 * out to a fully functional interim solution.
 *
 * Basically wraps the old style memory management in the new
 * programming interface, but is more expressive and avoids many of
 * the bugs in the old texture manager.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <xf86drm.h>
#include <pthread.h>
#include "intel_bufmgr.h"
#include "intel_bufmgr_priv.h"
#include "drm.h"
#include "i915_drm.h"
#include "mm.h"
#include "libdrm.h"
#include "libdrm_lists.h"

/* Support gcc's __FUNCTION__ for people using other compilers */
#if !defined(__GNUC__) && !defined(__FUNCTION__)
# define __FUNCTION__ __func__ /* C99 */
#endif

#define DBG(...) do {					\
	if (bufmgr_fake->bufmgr.debug)			\
		drmMsg(__VA_ARGS__);			\
} while (0)

/* Internal flags:
 */
#define BM_NO_BACKING_STORE			0x00000001
#define BM_NO_FENCE_SUBDATA			0x00000002
#define BM_PINNED				0x00000004

/* Wrapper around mm.c's mem_block, which understands that you must
 * wait for fences to expire before memory can be freed.  This is
 * specific to our use of memcpy for uploads - an upload that was
 * processed through the command queue wouldn't need to care about
 * fences.
 */
#define MAX_RELOCS 4096

struct fake_buffer_reloc {
	/** Buffer object that the relocation points at. */
	drm_intel_bo *target_buf;
	/** Offset of the relocation entry within reloc_buf. */
	uint32_t offset;
	/**
	 * Cached value of the offset when we last performed this relocation.
	 */
	uint32_t last_target_offset;
	/** Value added to target_buf's offset to get the relocation entry. */
	uint32_t delta;
	/** Cache domains the target buffer is read into. */
	uint32_t read_domains;
	/** Cache domain the target buffer will have dirty cachelines in. */
	uint32_t write_domain;
};

struct block {
	struct block *next, *prev;
	struct mem_block *mem;	/* BM_MEM_AGP */

	/**
	 * Marks that the block is currently in the aperture and has yet to be
	 * fenced.
	 */
	unsigned on_hardware:1;
	/**
	 * Marks that the block is currently fenced (being used by rendering)
	 * and can't be freed until @fence is passed.
	 */
	unsigned fenced:1;

	/** Fence cookie for the block. */
	unsigned fence;		/* Split to read_fence, write_fence */

	drm_intel_bo *bo;
	void *virtual;
};

typedef struct _bufmgr_fake {
	drm_intel_bufmgr bufmgr;

	pthread_mutex_t lock;

	unsigned long low_offset;
	unsigned long size;
	void *virtual;

	struct mem_block *heap;

	unsigned buf_nr;	/* for generating ids */

	/**
	 * List of blocks which are currently in the GART but haven't been
	 * fenced yet.
	 */
	struct block on_hardware;
	/**
	 * List of blocks which are in the GART and have an active fence on
	 * them.
	 */
	struct block fenced;
	/**
	 * List of blocks which have an expired fence and are ready to be
	 * evicted.
	 */
	struct block lru;

	unsigned int last_fence;

	unsigned fail:1;
	unsigned need_fence:1;
	int thrashing;

	/**
	 * Driver callback to emit a fence, returning the cookie.
	 *
	 * This allows the driver to hook in a replacement for the DRM usage in
	 * bufmgr_fake.
	 *
	 * Currently, this also requires that a write flush be emitted before
	 * emitting the fence, but this should change.
	 */
	unsigned int (*fence_emit) (void *private);
	/** Driver callback to wait for a fence cookie to have passed. */
	void (*fence_wait) (unsigned int fence, void *private);
	void *fence_priv;

	/**
	 * Driver callback to execute a buffer.
	 *
	 * This allows the driver to hook in a replacement for the DRM usage in
	 * bufmgr_fake.
	 */
	int (*exec) (drm_intel_bo *bo, unsigned int used, void *priv);
	void *exec_priv;

	/** Driver-supplied argument to driver callbacks */
	void *driver_priv;
	/**
	 * Pointer to kernel-updated sarea data for the last completed user irq
	 */
	volatile int *last_dispatch;

	int fd;

	int debug;

	int performed_rendering;
} drm_intel_bufmgr_fake;

typedef struct _drm_intel_bo_fake {
	drm_intel_bo bo;

	unsigned id;		/* debug only */
	const char *name;

	unsigned dirty:1;
	/**