tests: Bluetooth: bsim: Verify Periodic Advertiser duplicate filter

Verify Periodic Advertiser ADI support and duplicate filter.

Signed-off-by: Vinayak Kariappa Chettimada <e780c9f87dc729ad454f47292ad82c8652353064@nordicsemi.no>

--- tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c
+++ tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c
@@ -808,6 +808,16 @@
 	}
 	printk("success.\n");

+	k_sleep(K_MSEC(400));
+
+	printk("Update periodic advertising data (duplicate filter)...");
+	err = ll_adv_sync_ad_data_set(handle, AD_OP, sizeof(per_adv_data3),
+				      (void *)per_adv_data3);
+	if (err) {
+		goto exit;
+	}
+	printk("success.\n");
+
 	k_sleep(K_MSEC(1000));

 	printk("Disabling periodic...");
@@ -1609,8 +1619,6 @@
 	}
 	printk("done.\n");

-	printk("sync_report_len = %u\n", sync_report_len);
-
 	if (sync_report_len != 0) {
 		FAIL("Incorrect Periodic Advertising Report data.");
 	}
@@ -1658,7 +1666,7 @@
 	}

 	printk("Waiting for Periodic Advertising Report of %u bytes...",
-	       sizeof(per_adv_data1));
+	       sizeof(per_adv_data2));
 	sync_report_len_prev = sync_report_len;
 	while (!is_sync_report || (sync_report_len == sync_report_len_prev)) {
 		is_sync_report = false;
@@ -1709,8 +1717,10 @@

 	printk("Creating Periodic Advertising Sync 4 after sync lost...");
 	is_sync = false;
+	is_sync_report = false;
 	bt_addr_le_copy(&sync_create_param.addr, &per_addr);
-	sync_create_param.options = BT_LE_PER_ADV_SYNC_OPT_USE_PER_ADV_LIST;
+	sync_create_param.options = BT_LE_PER_ADV_SYNC_OPT_USE_PER_ADV_LIST |
+				    BT_LE_PER_ADV_SYNC_OPT_FILTER_DUPLICATE;
 	sync_create_param.sid = per_sid;
 	sync_create_param.skip = 0;
 	sync_create_param.timeout = 0xa;
@@ -1739,6 +1749,30 @@
 		goto exit;
 	}
 	printk("success.\n");
+
+	printk("Waiting for Periodic Advertising Report of %u bytes...",
+	       sizeof(per_adv_data3));
+	sync_report_len_prev = sync_report_len;
+	while (!is_sync_report || (sync_report_len == sync_report_len_prev)) {
+		is_sync_report = false;
+		k_sleep(K_MSEC(100));
+	}
+	printk("done.\n");
+
+	if ((sync_report_len != sizeof(per_adv_data3)) ||
+	    memcmp(sync_report_data, per_adv_data3, sizeof(per_adv_data3))) {
+		FAIL("Incorrect Periodic Advertising Report data (%u != %u).",
+		     sync_report_len, sizeof(per_adv_data3));
+	}
+
+	printk("Wait for no duplicate Periodic Advertising Report"
+	       " is generated...");
+	is_sync_report = false;
+	k_sleep(K_MSEC(400));
+	if (is_sync_report) {
+		goto exit;
+	}
+	printk("success\n");

 	printk("Deleting Periodic Advertising Sync 4...");
 	err = bt_le_per_adv_sync_delete(sync);


monitor: Add supported commands bit numbers

--- monitor/packet.c
+++ monitor/packet.c
@@ -3632,6 +3632,7 @@

 struct opcode_data {
 	uint16_t opcode;
+	int bit;
 	const char *str;
 	void (*cmd_func) (const void *data, uint8_t size);
 	uint8_t cmd_size;
@@ -3642,476 +3643,476 @@
 };

 static const struct opcode_data opcode_table[] = {
-	{ 0x0000, "NOP" },
+	{ 0x0000,  -1, "NOP" },

 	/* OGF 1 - Link Control */
-	{ 0x0401, "Inquiry",
+	{ 0x0401,   0, "Inquiry",
 				inquiry_cmd, 5, true },
-	{ 0x0402, "Inquiry Cancel",
+	{ 0x0402,   1, "Inquiry Cancel",
 				null_cmd, 0, true,
 				status_rsp, 1, true },
-	{ 0x0403, "Periodic Inquiry Mode",
+	{ 0x0403,   2, "Periodic Inquiry Mode",
 				periodic_inquiry_cmd, 9, true,
 				status_rsp, 1, true },
-	{ 0x0404, "Exit Periodic Inquiry Mode",
+	{ 0x0404,   3, "Exit Periodic Inquiry Mode",
 				null_cmd, 0, true,
 				status_rsp, 1, true },
-	{ 0x0405, "Create Connection",
+	{ 0x0405,   4, "Create Connection",
 				create_conn_cmd, 13, true },
-	{ 0x0406, "Disconnect",
+	{ 0x0406,   5, "Disconnect",
 				disconnect_cmd, 3, true },
-	{ 0x0407, "Add SCO Connection",
+	{ 0x0407,   6, "Add SCO Connection",
 				add_sco_conn_cmd, 4, true },
-	{ 0x0408, "Create Connection Cancel",
+	{ 0x0408,   7, "Create Connection Cancel",
 				create_conn_cancel_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x0409, "Accept Connection Request",
+	{ 0x0409,   8, "Accept Connection Request",
 				accept_conn_request_cmd, 7, true },
-	{ 0x040a, "Reject Connection Request",
+	{ 0x040a,   9, "Reject Connection Request",
 				reject_conn_request_cmd, 7, true },
-	{ 0x040b, "Link Key Request Reply",
+	{ 0x040b,  10, "Link Key Request Reply",
 				link_key_request_reply_cmd, 22, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x040c, "Link Key Request Negative Reply",
+	{ 0x040c,  11, "Link Key Request Negative Reply",
 				link_key_request_neg_reply_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x040d, "PIN Code Request Reply",
+	{ 0x040d,  12, "PIN Code Request Reply",
 				pin_code_request_reply_cmd, 23, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x040e, "PIN Code Request Negative Reply",
+	{ 0x040e,  13, "PIN Code Request Negative Reply",
 				pin_code_request_neg_reply_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x040f, "Change Connection Packet Type",
+	{ 0x040f,  14, "Change Connection Packet Type",
 				change_conn_pkt_type_cmd, 4, true },
 	/* reserved command */
-	{ 0x0411, "Authentication Requested",
+	{ 0x0411,  15, "Authentication Requested",
 				auth_requested_cmd, 2, true },
 	/* reserved command */
-	{ 0x0413, "Set Connection Encryption",
+	{ 0x0413,  16, "Set Connection Encryption",
 				set_conn_encrypt_cmd, 3, true },
 	/* reserved command */
-	{ 0x0415, "Change Connection Link Key",
+	{ 0x0415,  17, "Change Connection Link Key",
 				change_conn_link_key_cmd, 2, true },
 	/* reserved command */
-	{ 0x0417, "Master Link Key",
+	{ 0x0417,  18, "Master Link Key",
 				master_link_key_cmd, 1, true },
 	/* reserved command */
-	{ 0x0419, "Remote Name Request",
+	{ 0x0419,  19, "Remote Name Request",
 				remote_name_request_cmd, 10, true },
-	{ 0x041a, "Remote Name Request Cancel",
+	{ 0x041a,  20, "Remote Name Request Cancel",
 				remote_name_request_cancel_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x041b, "Read Remote Supported Features",
+	{ 0x041b,  21, "Read Remote Supported Features",
 				read_remote_features_cmd, 2, true },
-	{ 0x041c, "Read Remote Extended Features",
+	{ 0x041c,  22, "Read Remote Extended Features",
 				read_remote_ext_features_cmd, 3, true },
-	{ 0x041d, "Read Remote Version Information",
+	{ 0x041d,  23, "Read Remote Version Information",
 				read_remote_version_cmd, 2, true },
 	/* reserved command */
-	{ 0x041f, "Read Clock Offset",
+	{ 0x041f,  24, "Read Clock Offset",
 				read_clock_offset_cmd, 2, true },
-	{ 0x0420, "Read LMP Handle",
+	{ 0x0420,  25, "Read LMP Handle",
 				read_lmp_handle_cmd, 2, true,
 				read_lmp_handle_rsp, 8, true },
 	/* reserved commands */
-	{ 0x0428, "Setup Synchronous Connection",
+	{ 0x0428, 131, "Setup Synchronous Connection",
 				setup_sync_conn_cmd, 17, true },
-	{ 0x0429, "Accept Synchronous Connection",
+	{ 0x0429, 132, "Accept Synchronous Connection",
 				accept_sync_conn_cmd, 21, true },
-	{ 0x042a, "Reject Synchronous Connection",
+	{ 0x042a, 133, "Reject Synchronous Connection",
 				reject_sync_conn_cmd, 7, true },
-	{ 0x042b, "IO Capability Request Reply",
+	{ 0x042b, 151, "IO Capability Request Reply",
 				io_capability_request_reply_cmd, 9, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x042c, "User Confirmation Request Reply",
+	{ 0x042c, 152, "User Confirmation Request Reply",
 				user_confirm_request_reply_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x042d, "User Confirmation Request Neg Reply",
+	{ 0x042d, 153, "User Confirmation Request Neg Reply",
 				user_confirm_request_neg_reply_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x042e, "User Passkey Request Reply",
+	{ 0x042e, 154, "User Passkey Request Reply",
 				user_passkey_request_reply_cmd, 10, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x042f, "User Passkey Request Negative Reply",
+	{ 0x042f, 155, "User Passkey Request Negative Reply",
 				user_passkey_request_neg_reply_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x0430, "Remote OOB Data Request Reply",
+	{ 0x0430, 156, "Remote OOB Data Request Reply",
 				remote_oob_data_request_reply_cmd, 38, true,
 				status_bdaddr_rsp, 7, true },
 	/* reserved commands */
-	{ 0x0433, "Remote OOB Data Request Neg Reply",
+	{ 0x0433, 159, "Remote OOB Data Request Neg Reply",
 				remote_oob_data_request_neg_reply_cmd, 6, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x0434, "IO Capability Request Negative Reply",
+	{ 0x0434, 163, "IO Capability Request Negative Reply",
 				io_capability_request_neg_reply_cmd, 7, true,
 				status_bdaddr_rsp, 7, true },
-	{ 0x0435, "Create Physical Link",
+	{ 0x0435, 168, "Create Physical Link",
 				create_phy_link_cmd, 3, false },
-	{ 0x0436, "Accept Physical Link",
+	{ 0x0436, 169, "Accept Physical Link",
 				accept_phy_link_cmd, 3, false },
-	{ 0x0437, "Disconnect Physical Link",
+	{ 0x0437, 170, "Disconnect Physical Link",
 				disconn_phy_link_cmd, 2, true },
-	{ 0x0438, "Create Logical Link",
+	{ 0x0438, 171, "Create Logical Link",
 				create_logic_link_cmd, 33, true },
-	{ 0x0439, "Accept Logical Link",
+	{ 0x0439, 172, "Accept Logical Link",
 				accept_logic_link_cmd, 33, true },
-	{ 0x043a, "Disconnect Logical Link",
+	{ 0x043a, 173, "Disconnect Logical Link",
 				disconn_logic_link_cmd, 2, true },
-	{ 0x043b, "Logical Link Cancel",
+	{ 0x043b, 174, "Logical Link Cancel",
 				logic_link_cancel_cmd, 2, true,
 				logic_link_cancel_rsp, 3, true },
-	{ 0x043c, "Flow Specifcation Modify",
+	{ 0x043c, 175, "Flow Specifcation Modify",
 				flow_spec_modify_cmd, 34, true },
-	{ 0x043d, "Enhanced Setup Synchronous Connection" },
-	{ 0x043e, "Enhanced Accept Synchronous Connection" },
+	{ 0x043d, 235, "Enhanced Setup Synchronous Connection" },
+	{ 0x043e, 236, "Enhanced Accept Synchronous Connection" },

 	/* OGF 2 - Link Policy */
-	{ 0x0801, "Holde Mode",
+	{ 0x0801,  33, "Holde Mode",
 				hold_mode_cmd, 6, true },
 	/* reserved command */
-	{ 0x0803, "Sniff Mode",
+	{ 0x0803,  34, "Sniff Mode",
 				sniff_mode_cmd, 10, true },
-	{ 0x0804, "Exit Sniff Mode",
+	{ 0x0804,  35, "Exit Sniff Mode",
 				exit_sniff_mode_cmd, 2, true },
-	{ 0x0805, "Park State",
+	{ 0x0805,  36, "Park State",
 				park_state_cmd, 6, true },
-	{ 0x0806, "Exit Park State",
+	{ 0x0806,  37, "Exit Park State",
 				exit_park_state_cmd, 2, true },
-	{ 0x0807, "QoS Setup",
+	{ 0x0807,  38, "QoS Setup",
 				qos_setup_cmd, 20, true },
 	/* reserved command */
-	{ 0x0809, "Role Discovery",
+	{ 0x0809,  39, "Role Discovery",
 				role_discovery_cmd, 2, true,
 				role_discovery_rsp, 4, true },
 	/* reserved command */
-	{ 0x080b, "Switch Role",
+	{ 0x080b,  40, "Switch Role",
 				switch_role_cmd, 7, true },
-	{ 0x080c, "Read Link Policy Settings",
+	{ 0x080c,  41, "Read Link Policy Settings",
 				read_link_policy_cmd, 2, true,
 				read_link_policy_rsp, 5, true },
-	{ 0x080d, "Write Link Policy Settings",
+	{ 0x080d,  42, "Write Link Policy Settings",
 				write_link_policy_cmd, 2, true,
 				write_link_policy_rsp, 2, true },
-	{ 0x080e, "Read Default Link Policy Settings",
+	{ 0x080e,  43, "Read Default Link Policy Settings",
 				null_cmd, 0, true,
 				read_default_link_policy_rsp, 3, true },
-	{ 0x080f, "Write Default Link Policy Settings",
+	{ 0x080f,  44, "Write Default Link Policy Settings",
 				write_default_link_policy_cmd, 2, true,
 				status_rsp, 1, true },
-	{ 0x0810, "Flow Specification",
+	{ 0x0810,  45, "Flow Specification",
 				flow_spec_cmd, 21, true },
-	{ 0x0811, "Sniff Subrating",
+	{ 0x0811, 140, "Sniff Subrating",
 				sniff_subrating_cmd, 8, true,
 				sniff_subrating_rsp, 3, true },

 	/* OGF 3 - Host Control */
-	{ 0x0c01, "Set Event Mask",
+	{ 0x0c01,  46, "Set Event Mask",
 				set_event_mask_cmd, 8, true,
 				status_rsp, 1, true },
 	/* reserved command */
-	{ 0x0c03, "Reset",
+	{ 0x0c03,  47, "Reset",
 				null_cmd, 0, true,
 				status_rsp, 1, true },
 	/* reserved command */
-	{ 0x0c05, "Set Event Filter",
+	{ 0x0c05,  48, "Set Event Filter",
 				set_event_filter_cmd, 1, false,
 				status_rsp, 1, true },
 	/* reserved commands */
-	{ 0x0c08, "Flush",
+	{ 0x0c08,  49, "Flush",
 				flush_cmd, 2, true,
 				flush_rsp, 3, true },
-	{ 0x0c09, "Read PIN Type",
+	{ 0x0c09,  50, "Read PIN Type",
 				null_cmd, 0, true,
 				read_pin_type_rsp, 2, true },
-	{ 0x0c0a, "Write PIN Type",
+	{ 0x0c0a,  51, "Write PIN Type",
 				write_pin_type_cmd, 1, true,
 				status_rsp, 1, true },
-	{ 0x0c0b, "Create New Unit Key",
+	{ 0x0c0b,  52, "Create New Unit Key",
 				null_cmd, 0, true,
 				status_rsp, 1, true },
 	/* reserved command */
-	{ 0x0c0d, "Read Stored Link Key",
+	{ 0x0c0d,  53, "Read Stored Link Key",
 				read_stored_link_key_cmd, 7, true,
 				read_stored_link_key_rsp, 5, true },
 	/* reserved commands */
-	{ 0x0c11, "Write Stored Link Key",
+	{ 0x0c11,  54, "Write Stored Link Key",
 				write_stored_link_key_cmd, 1, false,
 				write_stored_link_key_rsp, 2, true },
-	{ 0x0c12, "Delete Stored Link Key",
+	{ 0x0c12,  55, "Delete Stored Link Key",
 				delete_stored_link_key_cmd, 7, true,
 				delete_stored_link_key_rsp, 3, true },
-	{ 0x0c13, "Write Local Name",
+	{ 0x0c13,  56, "Write Local Name",
 				write_local_name_cmd, 248, true,
 				status_rsp, 1, true },
-	{ 0x0c14, "Read Local Name",
+	{ 0x0c14,  57, "Read Local Name",
 				null_cmd, 0, true,
 				read_local_name_rsp, 249, true },
-	{ 0x0c15, "Read Connection Accept Timeout",
+	{ 0x0c15,  58, "Read Connection Accept Timeout",
 				null_cmd, 0, true,
 				read_conn_accept_timeout_rsp, 3, true },
-	{ 0x0c16, "Write Connection Accept Timeout",
+	{ 0x0c16,  59, "Write Connection Accept Timeout",
 				write_conn_accept_timeout_cmd, 2, true,
 				status_rsp, 1, true },
-	{ 0x0c17, "Read Page Timeout",
+	{ 0x0c17,  60, "Read Page Timeout",
 				null_cmd, 0, true,
 				read_page_timeout_rsp, 3, true },
-	{ 0x0c18, "Write Page Timeout",
+	{ 0x0c18,  61, "Write Page Timeout",
 				write_page_timeout_cmd, 2, true,
 				status_rsp, 1, true },
-	{ 0x0c19, "Read Scan Enable",
+	{ 0x0c19,  62, "Read Scan Enable",
 				null_cmd, 0, true,
 				read_scan_enable_rsp, 2, true },
-	{ 0x0c1a, "Write Scan Enable",
+	{ 0x0c1a,  63, "Write Scan Enable",
 				write_scan_enable_cmd, 1, true,
 				status_rsp, 1, true },
-	{ 0x0c1b, "Read Page Scan Activity"		},
-	{ 0x0c1c, "Write Page Scan Activity"		},
-	{ 0x0c1d, "Read Inquiry Scan Activity"		},
-	{ 0x0c1e, "Write Inquiry Scan Activity"		},
-	{ 0x0c1f, "Read Authentication Enable"		},
-	{ 0x0c20, "Write Authentication Enable"		},
-	{ 0x0c21, "Read Encryption Mode"		},
-	{ 0x0c22, "Write Encryption Mode"		},
-	{ 0x0c23, "Read Class of Device",
+	{ 0x0c1b,  64, "Read Page Scan Activity" },
+	{ 0x0c1c,  65, "Write Page Scan Activity" },
+	{ 0x0c1d,  66, "Read Inquiry Scan Activity" },
+	{ 0x0c1e,  67, "Write Inquiry Scan Activity" },
+	{ 0x0c1f,  68, "Read Authentication Enable" },
+	{ 0x0c20,  69, "Write Authentication Enable" },
+	{ 0x0c21,  70, "Read Encryption Mode" },
+	{ 0x0c22,  71, "Write Encryption Mode" },
+	{ 0x0c23,  72, "Read Class of Device",
 				null_cmd, 0, true,
 				read_class_of_dev_rsp, 4, true },
-	{ 0x0c24, "Write Class of Device",
+	{ 0x0c24,  73, "Write Class of Device",
 				write_class_of_dev_cmd, 3, true,
 				status_rsp, 1, true },
-	{ 0x0c25, "Read Voice Setting",
+	{ 0x0c25,  74, "Read Voice Setting",
 				null_cmd, 0, true,
 				read_voice_setting_rsp, 3, true },
-	{ 0x0c26, "Write Voice Setting",
+	{ 0x0c26,  75, "Write Voice Setting",
 				write_voice_setting_cmd, 2, true,
 				status_rsp, 1, true },
-	{ 0x0c27, "Read Automatic Flush Timeout"	},
-	{ 0x0c28, "Write Automatic Flush Timeout"	},
-	{ 0x0c29, "Read Num Broadcast Retransmissions"	},
-	{ 0x0c2a, "Write Num Broadcast Retransmissions"	},
-	{ 0x0c2b, "Read Hold Mode Activity"		},
-	{ 0x0c2c, "Write Hold Mode Activity"		},
-	{ 0x0c2d, "Read Transmit Power Level"		},
-	{ 0x0c2e, "Read Sync Flow Control Enable"	},
-	{ 0x0c2f, "Write Sync Flow Control Enable"	},
+	{ 0x0c27,  76, "Read Automatic Flush Timeout" },
+	{ 0x0c28,  77, "Write Automatic Flush Timeout" },
+	{ 0x0c29,  78, "Read Num Broadcast Retransmissions" },
+	{ 0x0c2a,  79, "Write Num Broadcast Retransmissions" },
+	{ 0x0c2b,  80, "Read Hold Mode Activity" },
+	{ 0x0c2c,  81, "Write Hold Mode Activity" },
+	{ 0x0c2d,  82, "Read Transmit Power Level" },
+	{ 0x0c2e,  83, "Read Sync Flow Control Enable" },
+	{ 0x0c2f,  84, "Write Sync Flow Control Enable" },
 	/* reserved command */
-	{ 0x0c31, "Set Host Controller To Host Flow"	},
+	{ 0x0c31,  85, "Set Host Controller To Host Flow" },
 	/* reserved command */
-	{ 0x0c33, "Host Buffer Size"			},
+	{ 0x0c33,  86, "Host Buffer Size" },
 	/* reserved command */
-	{ 0x0c35, "Host Number of Completed Packets"	},
-	{ 0x0c36, "Read Link Supervision Timeout"	},
-	{ 0x0c37, "Write Link Supervision Timeout"	},
-	{ 0x0c38, "Read Number of Supported IAC"	},
-	{ 0x0c39, "Read Current IAC LAP"		},
-	{ 0x0c3a, "Write Current IAC LAP"		},
-	{ 0x0c3b, "Read Page Scan Period Mode"		},
-	{ 0x0c3c, "Write Page Scan Period Mode"		},
-	{ 0x0c3d, "Read Page Scan Mode"			},
-	{ 0x0c3e, "Write Page Scan Mode"		},
-	{ 0x0c3f, "Set AFH Host Channel Classification"	},
+	{ 0x0c35,  87, "Host Number of Completed Packets" },
+	{ 0x0c36,  88, "Read Link Supervision Timeout" },
+	{ 0x0c37,  89, "Write Link Supervision Timeout" },
+	{ 0x0c38,  90, "Read Number of Supported IAC" },
+	{ 0x0c39,  91, "Read Current IAC LAP" },
+	{ 0x0c3a,  92, "Write Current IAC LAP" },
+	{ 0x0c3b,  93, "Read Page Scan Period Mode" },
+	{ 0x0c3c,  94, "Write Page Scan Period Mode" },
+	{ 0x0c3d,  95, "Read Page Scan Mode" },
+	{ 0x0c3e,  96, "Write Page Scan Mode" },
+	{ 0x0c3f,  97, "Set AFH Host Channel Classification" },
 	/* reserved commands */
-	{ 0x0c42, "Read Inquiry Scan Type"		},
-	{ 0x0c43, "Write Inquiry Scan Type"		},
-	{ 0x0c44, "Read Inquiry Mode",
+	{ 0x0c42, 100, "Read Inquiry Scan Type" },
+	{ 0x0c43, 101, "Write Inquiry Scan Type" },
+	{ 0x0c44, 102, "Read Inquiry Mode",
 				null_cmd, 0, true,
 				read_inquiry_mode_rsp, 2, true },
-	{ 0x0c45, "Write Inquiry Mode",
+	{ 0x0c45, 103, "Write Inquiry Mode",
 				write_inquiry_mode_cmd, 1, true,
 				status_rsp, 1, true },
-	{ 0x0c46, "Read Page Scan Type"			},
-	{ 0x0c47, "Write Page Scan Type"		},
-	{ 0x0c48, "Read AFH Channel Assessment Mode"	},
-	{ 0x0c49, "Write AFH Channel Assessment Mode"	},
+	{ 0x0c46, 104, "Read Page Scan Type" },
+	{ 0x0c47, 105, "Write Page Scan Type" },
+	{ 0x0c48, 106, "Read AFH Channel Assessment Mode" },
+	{ 0x0c49, 107, "Write AFH Channel Assessment Mode" },
 	/* reserved commands */
-	{ 0x0c51, "Read Extended Inquiry Response",
+	{ 0x0c51, 136, "Read Extended Inquiry Response",
 				null_cmd, 0, true,
 				read_ext_inquiry_response_rsp, 242, true },
-	{ 0x0c52, "Write Extended Inquiry Response",
+	{ 0x0c52, 137, "Write Extended Inquiry Response",
 				write_ext_inquiry_response_cmd, 241, true,
 				status_rsp, 1, true },
-	{ 0x0c53, "Refresh Encryption Key",
+	{ 0x0c53, 138, "Refresh Encryption Key",
 				refresh_encrypt_key_cmd, 2, true },
 	/* reserved command */
-	{ 0x0c55, "Read Simple Pairing Mode",
+	{ 0x0c55, 141, "Read Simple Pairing Mode",
 				null_cmd, 0, true,
 				read_simple_pairing_mode_rsp, 2, true },
-	{ 0x0c56, "Write Simple Pairing Mode",
+	{ 0x0c56, 142, "Write Simple Pairing Mode",
 				write_simple_pairing_mode_cmd, 1, true,
 				status_rsp, 1, true },
-	{ 0x0c57, "Read Local OOB Data"			},
-	{ 0x0c58, "Read Inquiry Response TX Power Level",
+	{ 0x0c57, 143, "Read Local OOB Data" },
+	{ 0x0c58, 144, "Read Inquiry Response TX Power Level",
 				null_cmd, 0, true,
 				read_inquiry_resp_tx_power_rsp, 2, true },
-	{ 0x0c59, "Write Inquiry Transmit Power Level"	},
-	{ 0x0c5a, "Read Default Erroneous Reporting"	},
-	{ 0x0c5b, "Write Default Erroneous Reporting"	},
+	{ 0x0c59, 145, "Write Inquiry Transmit Power Level" },
+	{ 0x0c5a, 146, "Read Default Erroneous Reporting" },
+	{ 0x0c5b, 146, "Write Default Erroneous Reporting" },
 	/* reserved commands */
-	{ 0x0c5f, "Enhanced Flush",
+	{ 0x0c5f, 158, "Enhanced Flush",
 				enhanced_flush_cmd, 3, true },
-	/* reserved command */
-	{ 0x0c61, "Read Logical Link Accept Timeout"	},
-	{ 0x0c62, "Write Logical Link Accept Timeout"	},
-	{ 0x0c63, "Set Event Mask Page 2",
+	{ 0x0c60, 162, "Send Keypress Notification" },
+	{ 0x0c61, 176, "Read Logical Link Accept Timeout" },
+	{ 0x0c62, 177, "Write Logical Link Accept Timeout" },
+	{ 0x0c63, 178, "Set Event Mask Page 2",
 				set_event_mask_page2_cmd, 8, true,
 				status_rsp, 1, true },
-	{ 0x0c64, "Read Location Data"			},
-	{ 0x0c65, "Write Location Data"			},
-	{ 0x0c66, "Read Flow Control Mode"		},
-	{ 0x0c67, "Write Flow Control Mode"		},
-	{ 0x0c68, "Read Enhanced Transmit Power Level"	},
-	{ 0x0c69, "Read Best Effort Flush Timeout"	},
-	{ 0x0c6a, "Write Best Effort Flush Timeout"	},
-	{ 0x0c6b, "Short Range Mode"			},
-	{ 0x0c6c, "Read LE Host Supported",
+	{ 0x0c64, 179, "Read Location Data" },
+	{ 0x0c65, 180, "Write Location Data" },
+	{ 0x0c66, 184, "Read Flow Control Mode" },
+	{ 0x0c67, 185, "Write Flow Control Mode" },
+	{ 0x0c68, 192, "Read Enhanced Transmit Power Level" },
+	{ 0x0c69, 194, "Read Best Effort Flush Timeout" },
+	{ 0x0c6a, 195, "Write Best Effort Flush Timeout" },
+	{ 0x0c6b, 196, "Short Range Mode" },
+	{ 0x0c6c, 197, "Read LE Host Supported",
 				null_cmd, 0, true,
 				read_le_host_supported_rsp, 3, true },
-	{ 0x0c6d, "Write LE Host Supported",
+	{ 0x0c6d, 198, "Write LE Host Supported",
 				write_le_host_supported_cmd, 2, true,
 				status_rsp, 1, true },
-	{ 0x0c6e, "Set MWS Channel Parameters"		},
-	{ 0x0c6f, "Set External Fram Configuration"	},
-	{ 0x0c70, "Set MWS Signaling"			},
-	{ 0x0c71, "Set MWS Transport Layer"		},
-	{ 0x0c72, "Set MWS Scan Frequency Table"	},
-	{ 0x0c73, "Set MWS Pattern Configuration"	},
+	{ 0x0c6e, 238, "Set MWS Channel Parameters" },
+	{ 0x0c6f, 239, "Set External Fram Configuration" },
+	{ 0x0c70, 240, "Set MWS Signaling" },
+	{ 0x0c71, 241, "Set MWS Transport Layer" },
+	{ 0x0c72, 242, "Set MWS Scan Frequency Table" },
+	{ 0x0c73, 244, "Set MWS Pattern Configuration" },

 	/* OGF 4 - Information Parameter */
-	{ 0x1001, "Read Local Version Information",
+	{ 0x1001, 115, "Read Local Version Information",
 				null_cmd, 0, true,
 				read_local_version_rsp, 9, true },
-	{ 0x1002, "Read Local Supported Commands",
+	{ 0x1002, 116, "Read Local Supported Commands",
 				null_cmd, 0, true,
 				read_local_commands_rsp, 65, true },
-	{ 0x1003, "Read Local Supported Features",
+	{ 0x1003, 117, "Read Local Supported Features",
 				null_cmd, 0, true,
 				read_local_features_rsp, 9, true },
-	{ 0x1004, "Read Local Extended Features",
+	{ 0x1004, 118, "Read Local Extended Features",
 				read_local_ext_features_cmd, 1, true,
 				read_local_ext_features_rsp, 11, true },
-	{ 0x1005, "Read Buffer Size",
+	{ 0x1005, 119, "Read Buffer Size",
 				null_cmd, 0, true,
 				read_buffer_size_rsp, 8, true },
 	/* reserved command */
-	{ 0x1007, "Read Country Code",
+	{ 0x1007, 120, "Read Country Code",
 				null_cmd, 0, true,
 				read_country_code_rsp, 2, true },
 	/* reserved command */
-	{ 0x1009, "Read BD ADDR",
+	{ 0x1009, 121, "Read BD ADDR",
 				null_cmd, 0, true,
 				read_bd_addr_rsp, 7, true },
-	{ 0x100a, "Read Data Block Size",
+	{ 0x100a, 186, "Read Data Block Size",
 				null_cmd, 0, true,
 				read_data_block_size_rsp, 7, true },
-	{ 0x100b, "Read Local Supported Codecs" },
+	{ 0x100b, 237, "Read Local Supported Codecs" },

 	/* OGF 5 - Status Parameter */
-	{ 0x1401, "Read Failed Contact Counter"		},
-	{ 0x1402, "Reset Failed Contact Counter"	},
-	{ 0x1403, "Read Link Quality"			},
+	{ 0x1401, 122, "Read Failed Contact Counter" },
+	{ 0x1402, 123, "Reset Failed Contact Counter" },
+	{ 0x1403, 124, "Read Link Quality" },
 	/* reserved command */
-	{ 0x1405, "Read RSSI"				},
-	{ 0x1406, "Read AFH Channel Map"		},
-	{ 0x1407, "Read Clock"				},
-	{ 0x1408, "Read Encryption Key Size",
+	{ 0x1405, 125, "Read RSSI" },
+	{ 0x1406, 126, "Read AFH Channel Map" },
+	{ 0x1407, 127, "Read Clock" },
+	{ 0x1408, 164, "Read Encryption Key Size",
 				read_encrypt_key_size_cmd, 2, true,
 				read_encrypt_key_size_rsp, 4, true },
-	{ 0x1409, "Read Local AMP Info",
+	{ 0x1409, 181, "Read Local AMP Info",
 				null_cmd, 0, true,
 				read_local_amp_info_rsp, 31, true },
-	{ 0x140a, "Read Local AMP ASSOC",
+	{ 0x140a, 182, "Read Local AMP ASSOC",
 				read_local_amp_assoc_cmd, 5, true,
 				read_local_amp_assoc_rsp, 5, false },
-	{ 0x140b, "Write Remote AMP ASSOC",
+	{ 0x140b, 183, "Write Remote AMP ASSOC",
 				write_remote_amp_assoc_cmd, 6, false,
 				write_remote_amp_assoc_rsp, 2, true },
-	{ 0x140c, "Get MWS Transport Layer Configuration" },
+	{ 0x140c, 243, "Get MWS Transport Layer Configuration" },

 	/* OGF 6 - Testing */
-	{ 0x1801, "Read Loopback Mode"			},
-	{ 0x1802, "Write Loopback Mode"			},
-	{ 0x1803, "Enable Device Under Test Mode"	},
-	{ 0x1804, "Write Simple Pairing Debug Mode"	},
+	{ 0x1801, 128, "Read Loopback Mode" },
+	{ 0x1802, 129, "Write Loopback Mode" },
+	{ 0x1803, 130, "Enable Device Under Test Mode" },
+	{ 0x1804, 157, "Write Simple Pairing Debug Mode" },
 	/* reserved commands */
-	{ 0x1807, "Enable AMP Receiver Reports"		},
-	{ 0x1808, "AMP Test End"			},
-	{ 0x1809, "AMP Test"				},
+	{ 0x1807, 189, "Enable AMP Receiver Reports" },
+	{ 0x1808, 190, "AMP Test End" },
+	{ 0x1809, 191, "AMP Test" },

 	/* OGF 8 - LE Control */
-	{ 0x2001, "LE Set Event Mask",
+	{ 0x2001, 200, "LE Set Event Mask",
 				le_set_event_mask_cmd, 8, true,
 				status_rsp, 1, true },
-	{ 0x2002, "LE Read Buffer Size",
+	{ 0x2002, 201, "LE Read Buffer Size",
 				null_cmd, 0, true,
 				le_read_buffer_size_rsp, 4, true },
-	{ 0x2003, "LE Read Local Supported Features",
+	{ 0x2003, 202, "LE Read Local Supported Features",
 				null_cmd, 0, true,
 				le_read_local_features_rsp, 9, true },
 	/* reserved command */
-	{ 0x2005, "LE Set Random Address",
+	{ 0x2005, 204, "LE Set Random Address",
 				le_set_random_address_cmd, 6, true,
 				status_rsp, 1, true },
-	{ 0x2006, "LE Set Advertising Parameters"	},
-	{ 0x2007, "LE Read Advertising Channel TX Power",
+	{ 0x2006, 205, "LE Set Advertising Parameters"	},
+	{ 0x2007, 206, "LE Read Advertising Channel TX Power",
 				null_cmd, 0, true,
 				le_read_adv_tx_power_rsp, 2, true },
-	{ 0x2008, "LE Set Advertising Data",
+	{ 0x2008, 207, "LE Set Advertising Data",
 				le_set_adv_data_cmd, 32, true,
 				status_rsp, 1, true },
-	{ 0x2009, "LE Set Scan Response Data",
+	{ 0x2009, 208, "LE Set Scan Response Data",
 				le_set_scan_response_data_cmd, 32, true,
 				status_rsp, 1, true },
-	{ 0x200a, "LE Set Advertise Enable",
+	{ 0x200a, 209, "LE Set Advertise Enable",
 				le_set_adv_enable_cmd, 1, true,
 				status_rsp, 1, true },
-	{ 0x200b, "LE Set Scan Parameters",
+	{ 0x200b, 210, "LE Set Scan Parameters",
 				le_set_scan_parameters_cmd, 7, true,
 				status_rsp, 1, true },
-	{ 0x200c, "LE Set Scan Enable",
+	{ 0x200c, 211, "LE Set Scan Enable",
 				le_set_scan_enable_cmd, 2, true,
 				status_rsp, 1, true },
-	{ 0x200d, "LE Create Connection",
+	{ 0x200d, 212, "LE Create Connection",
 				le_create_conn_cmd, 25, true },
-	{ 0x200e, "LE Create Connection Cancel",
+	{ 0x200e, 213, "LE Create Connection Cancel",
 				null_cmd, 0, true,
 				status_rsp, 1, true },
-	{ 0x200f, "LE Read White List Size",
+	{ 0x200f, 214, "LE Read White List Size",
 				null_cmd, 0, true,
 				le_read_white_list_size_rsp, 2, true },
-	{ 0x2010, "LE Clear White List",
+	{ 0x2010, 215, "LE Clear White List",
 				null_cmd, 0, true,
 				status_rsp, 1, true },
-	{ 0x2011, "LE Add Device To White List",
+	{ 0x2011, 216, "LE Add Device To White List",
 				le_add_to_white_list_cmd, 7, true,
 				status_rsp, 1, true },
-	{ 0x2012, "LE Remove Device From White List",
+	{ 0x2012, 217, "LE Remove Device From White List",
 				le_remove_from_white_list_cmd, 7, true,
 				status_rsp, 1, true },
-	{ 0x2013, "LE Connection Update",
+	{ 0x2013, 218, "LE Connection Update",
 				le_conn_update_cmd, 14, true },
-	{ 0x2014, "LE Set Host Channel Classification",
+	{ 0x2014, 219, "LE Set Host Channel Classification",
 				le_set_host_classification_cmd, 5, true,
 				status_rsp, 1, true },
-	{ 0x2015, "LE Read Channel Map",
+	{ 0x2015, 220, "LE Read Channel Map",
 				le_read_channel_map_cmd, 2, true,
 				le_read_channel_map_rsp, 8, true },
-	{ 0x2016, "LE Read Remote Used Features",
+	{ 0x2016, 221, "LE Read Remote Used Features",
 				le_read_remote_features_cmd, 2, true },
-	{ 0x2017, "LE Encrypt",
+	{ 0x2017, 222, "LE Encrypt",
 				le_encrypt_cmd, 32, true,
 				le_encrypt_rsp, 17, true },
-	{ 0x2018, "LE Rand",
+	{ 0x2018, 223, "LE Rand",
 				null_cmd, 0, true,
 				le_rand_rsp, 9, true },
-	{ 0x2019, "LE Start Encryption",
+	{ 0x2019, 224, "LE Start Encryption",
 				le_start_encrypt, 28, true },
-	{ 0x201a, "LE Long Term Key Request Reply"	},
-	{ 0x201b, "LE Long Term Key Request Neg Reply"	},
-	{ 0x201c, "LE Read Supported States",
+	{ 0x201a, 225, "LE Long Term Key Request Reply" },
+	{ 0x201b, 226, "LE Long Term Key Request Neg Reply" },
+	{ 0x201c, 227, "LE Read Supported States",
 				null_cmd, 0, true,
 				le_read_supported_states_rsp, 9, true },
-	{ 0x201d, "LE Receiver Test"			},
-	{ 0x201e, "LE Transmitter Test"			},
-	{ 0x201f, "LE Test End"				},
+	{ 0x201d, 228, "LE Receiver Test" },
+	{ 0x201e, 229, "LE Transmitter Test" },
+	{ 0x201f, 230, "LE Test End" },
 	{ }
 };


Compilation fix.

Compilation fix.

--- gotools-core/include/GoTools/geometry/PointCloud.h
+++ gotools-core/include/GoTools/geometry/PointCloud.h
@@ -159,7 +159,7 @@
     /// are (consecutively) stored.
     /// \return a constant pointer to the coordinate storage area
     const double* rawData() const
-    { return (points.size() == 0) ? nullptr : points_[0].begin(); }
+    { return (points_.size() == 0) ? nullptr : points_[0].begin(); }

     /// Get a reference to the vector where the points are stored
     /// \return a reference to the point coordinate vector


Fix for help string readability if keyword > 16 char (#11)

--- third-party/bigcode/uCli/module/src/ucli_module.c
+++ third-party/bigcode/uCli/module/src/ucli_module.c
@@ -233,7 +233,7 @@
     }

     BIGLIST_FOREACH_DATA(ble, mod->command_list, ucli_command_t*, cp) {
-        aim_printf(pvs, "  %-16s%s\n",
+        aim_printf(pvs, "  %-16s %s\n",
                    cp->command, cp->help.summary ? cp->help.summary : "");
     }


Update to new du() function signature

Update to new du() function signature

git-svn-id: e88a1e38e13faf406e05cc89eca8dd613216f6c4@2702 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- trunk/libmesh/include/solvers/eigen_time_solver.h
+++ trunk/libmesh/include/solvers/eigen_time_solver.h
@@ -132,7 +132,7 @@
    * successive solution iterates ||u^{n+1} - u^{n}|| in some norm,
    * but for this class just returns 0.
    */
-  Real du (unsigned char) { return 0.; }
+  virtual Real du (const SystemNorm&) const { return 0.; }

   /**
    * The EigenSolver object.  This is what actually


sse: don't use vec_cmpne for float vectors on xlC

--- simde/x86/sse.h
+++ simde/x86/sse.h
@@ -776,7 +776,11 @@
     r_.neon_u32 = vmvnq_u32(vceqq_f32(a_.neon_f32, b_.neon_f32));
   #elif defined(SIMDE_SSE_WASM_SIMD128)
     r_.wasm_v128 = wasm_f32x4_ne(a_.wasm_v128, b_.wasm_v128);
-  #elif defined(SIMDE_SSE_POWER_ALTIVEC) && (SIMDE_ARCH_POWER >= 900)
+  #elif defined(SIMDE_SSE_POWER_ALTIVEC) && (SIMDE_ARCH_POWER >= 900) && !defined(HEDLEY_IBM_VERSION)
+    /* vec_cmpne(vector float, vector float) is missing from XL C/C++ v16.1.1,
+       though the documentation (table 89 on page 432 of the IBM XL C/C++ for
+       Linux Compiler Reference, Version 16.1.1) shows that it should be
+       present.  Both GCC and clang support it. */
     r_.altivec_f32 = (vector float) vec_cmpne(a_.altivec_f32, b_.altivec_f32);
   #elif defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
     r_.i32 = (__typeof__(r_.i32)) (a_.f32 != b_.f32);


Reorder includes

Reorder includes

--- uranus_dp/src/allocator/pseudoinverse_allocator.h
+++ uranus_dp/src/allocator/pseudoinverse_allocator.h
@@ -1,14 +1,15 @@
 #ifndef PSEUDOINVERSE_ALLOCATOR_H
 #define PSEUDOINVERSE_ALLOCATOR_H

+#include "uranus_dp/eigen_typedefs.h"
+#include "uranus_dp/eigen_helper.h"
+#include "vortex_msgs/ThrusterForces.h"
+
 #include "ros/ros.h"
+#include "geometry_msgs/Wrench.h"
+
 #include <Eigen/Dense>
 #include <vector>
-#include "geometry_msgs/Wrench.h"
-
-#include "vortex_msgs/ThrusterForces.h"
-#include "uranus_dp/eigen_typedefs.h"
-#include "uranus_dp/eigen_helper.h"

 class PseudoinverseAllocator
 {


better 'use strict' matching

better 'use strict' matching

--- simple/simple.c
+++ simple/simple.c
@@ -16,6 +16,9 @@

 // SSTACK__GROUP
 #define SPECIAL__FOR        1
+
+// SSTACK__BLOCK
+#define SPECIAL__INIT       1

 // SSTACK__CLASS
 // for e.g. "class extends {} {}", left is value (just one single token, or e.g. "(foo)")
@@ -278,7 +281,8 @@

   if (sd->curr->stype == SSTACK__BLOCK && sd->curr->t1.type) {
     // if parent is __BLOCK, just pretend a statement happened anyway
-    debugf("added weird direct-descendant-of-block ASI\n");
+    stack_inc(sd, 0);
+    --sd->curr;
     yield_virt(sd, TOKEN_SEMICOLON);
     return 1;
   }
@@ -311,23 +315,6 @@
   // dict state (left)
   if (sd->curr->stype == SSTACK__DICT) {
     uint8_t context = 0;
-
-    // // look for simplified options first
-    // if (sd->tok.type == TOKEN_LIT) {
-    //   // "foo," or "foo}"
-    //   if (sd->next->type == TOKEN_COMMA || sd->next->type == TOKEN_CLOSE) {
-    //     goto dict_symbol_only;
-    //   }
-
-    //   // catch "foo as bar", needed inside import dict (but invalid in regular dicts, so whatever)
-    //   if (sd->next->type == TOKEN_LIT && token_string(sd->next, "as", 2)) {
-    //     sd->tok.type = TOKEN_SYMBOL;
-    //     record_walk(sd, 0);  // consume symbol
-    //     sd->tok.type = TOKEN_KEYWORD;
-    //     record_walk(sd, 0);  // consume "as"
-    //     goto dict_symbol_only;
-    //   }
-    // }

     // search for function
     // ... look for 'async' without '(' next
@@ -418,18 +405,17 @@

     if (sd->tok.type == TOKEN_BRACE) {
       // terminal state of func, pop and insert normal block w/retained context
-      debugf("abandon function def: BRACE\n");
       uint8_t context = sd->curr->context;
       --sd->curr;
       record_walk(sd, 0);
       stack_inc(sd, SSTACK__BLOCK);
       sd->curr->context = context;
+      sd->curr->special = SPECIAL__INIT;
       return 0;
     }

     // invalid, abandon function def
     --sd->curr;
-    debugf("abandon function def: BAD (stype=%d)\n", sd->curr->stype);
     goto restart;
   }

@@ -473,18 +459,23 @@

   // zero state, determine what to push
   if (sd->curr->stype == SSTACK__BLOCK) {
+
+    // finished our first _anything_ clear initial bit
+    if (sd->curr->t1.type && sd->curr->special) {
+      sd->curr->special = 0;
+
+      // look for 'use strict' of single statement
+      if (sd->curr->t1.type == TOKEN_SEMICOLON) {
+        sstack *prev = (sd->curr + 1);  // this will be previous statement
+        if (!prev->t2.type && is_use_strict(&(prev->t1))) {
+          sd->curr->context |= CONTEXT__STRICT;
+          debugf("got use strict in single statement\n");
+        }
+      }
+    }
+
+    // check incase at least one statement has occured in DO_WHILE > BLOCK
     int has_statement = (sd->curr->t1.type == TOKEN_SEMICOLON || sd->curr->t1.type == TOKEN_BRACE);
-
-    // look for 'use strict' of single statement
-    if (sd->curr->t1.type == TOKEN_SEMICOLON && !sd->curr->t2.type) {
-      sstack *up = (sd->curr + 1);
-      if (!up->t2.type && is_use_strict(&(up->t1))) {
-        sd->curr->context |= CONTEXT__STRICT;
-        debugf("got use strict in single statement\n");
-      }
-    }
-
-    // check incase at least one statement has occured in DO_WHILE > BLOCK
     if ((sd->curr - 1)->stype == SSTACK__DO_WHILE && has_statement) {
       --sd->curr;  // pop to DO_WHILE

@@ -687,6 +678,7 @@
         record_walk(sd, -1);  // consume =>
         record_walk(sd, -1);  // consume {
         stack_inc(sd, SSTACK__BLOCK);
+        sd->curr->special = SPECIAL__INIT;
       } else {
         // just change statement's context (e.g. () => async () => () => ...)
         record_walk(sd, 0);
@@ -960,6 +952,7 @@
   sd.arg = arg;

   sd.curr->stype = SSTACK__BLOCK;
+  sd.curr->special = SPECIAL__INIT;
   record_walk(&sd, 0);

   int ret = 0;


tvservice: Use correct aspect ratio string for sd

--- host_applications/linux/apps/tvservice/tvservice.c
+++ host_applications/linux/apps/tvservice/tvservice.c
@@ -420,7 +420,7 @@
          }
       }
       //This is the format's aspect ratio
-      tmp = status_sprintf(mode_str, MAX_STATUS_STR_LENGTH, &offset, " %s", aspect_ratio_str(tvstate->display.sdtv.display_options.aspect));
+      tmp = status_sprintf(mode_str, MAX_STATUS_STR_LENGTH, &offset, " %s", aspect_ratio_sd_str(tvstate->display.sdtv.display_options.aspect));
    } else if (tvstate->state & VC_LCD_ATTACHED_DEFAULT) {
       status_sprintf(mode_str, MAX_STATUS_STR_LENGTH, &offset, "LCD");
    } else {


Assertion for LNET and change default sizes

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@3423 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/buffer.c
+++ slashd/buffer.c
@@ -18,8 +18,8 @@
 list_cache_t slBufsLru;
 list_cache_t slBufsPin;

-u32 slCacheBlkSz=16384;
-u32 slCacheNblks=64;
+u32 slCacheBlkSz=32768;
+u32 slCacheNblks=32;
 u32 slbFreeDef=100;
 u32 slbFreeMax=200;
 u32 slbFreeInc=10;
@@ -815,6 +815,8 @@
 void
 sl_buffer_cache_init(void)
 {
+	psc_assert(SLB_SIZE <= LNET_MTU);
+
 	lc_reginit(&slBufsFree, struct sl_buffer,
 		   slb_mgmt_lentry, "slabBufFree");
 	lc_reginit(&slBufsLru,  struct sl_buffer,


if seqno is smaller, I did work before

if seqno is smaller, I did work before

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@14728 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/mdslog.c
+++ slashd/mdslog.c
@@ -1203,6 +1203,11 @@
 		iosinfo = rpmi->rpmi_info;

 		RPMI_LOCK(rpmi);
+		if (iosinfo->si_seqno > seqno) {
+			RPMI_ULOCK(rpmi);
+			didwork++;
+			continue;
+		}
 		/*
 		 * All reclaim requests are send to a particular IOS in order.
 		 * If one IOS was slow/not responding, he has to wait


reduce startup spam

reduce startup spam

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@20671 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/mdslog.c
+++ slashd/mdslog.c
@@ -1126,6 +1126,7 @@
 	char *p, tmbuf[26];
 	mdsio_fid_t mf;
 	size_t nb;
+	time_t tm;
 	int rc;

 	rc = mdsio_lookup(current_vfsid,
@@ -1167,14 +1168,15 @@
 #endif

 	slm_set_curr_slashfid(mds_cursor.pjc_fid);
-	psclog_notice("File system was formatted on %"PRIu64" seconds "
-	    "since the Epoch", mds_cursor.pjc_timestamp);
-	psclog_notice("SLFID prior to replay="SLPRI_FID, mds_cursor.pjc_fid);
-	ctime_r((time_t *)&mds_cursor.pjc_timestamp, tmbuf);
+	psclog_info("SLFID prior to replay="SLPRI_FID,
+	    mds_cursor.pjc_fid);
+	tm = mds_cursor.pjc_timestamp;
+	ctime_r(&tm, tmbuf);
 	p = strchr(tmbuf, '\n');
 	if (p)
 		*p = '\0';
-	psclog_notice("File system was formatted on %s", tmbuf);
+	psclog_info("file system was formatted on %s "
+	    "(%"PSCPRI_TIMET")", tmbuf, tm);
 }

 void


add proto for mds_inode_release()

add proto for mds_inode_release()

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@7753 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/mdslog.h
+++ slashd/mdslog.h
@@ -3,26 +3,18 @@
 #ifndef _SLASHD_MDSLOG_H_
 #define _SLASHD_MDSLOG_H_

-#include "psc_types.h"
 #include "inode.h"
-#include "inodeh.h"
-#include "bmap.h"
-#include "slashrpc.h"

-extern void
-mds_inode_sync(void *);
+struct bmapc_memb;
+struct fidc_membh;
+struct slash_inode_handle;
+struct srm_bmap_crcup;

-extern void
-mds_inode_addrepl_log(struct slash_inode_handle *, sl_ios_id_t, uint32_t);
+int  mds_inode_release(struct fidc_membh *);
+void mds_bmap_crc_log(struct bmapc_memb *, struct srm_bmap_crcup *);
+void mds_bmap_repl_log(struct bmapc_memb *);
+void mds_bmap_sync(void *);
+void mds_inode_addrepl_log(struct slash_inode_handle *, sl_ios_id_t, uint32_t);
+void mds_inode_sync(void *);

-extern void
-mds_bmap_repl_log(struct bmapc_memb *);
-
-extern void
-mds_bmap_crc_log(struct bmapc_memb *, struct srm_bmap_crcup *);
-
-extern void
-mds_bmap_sync(void *);
-
-
-#endif
+#endif /* _SLASHD_MDSLOG_H_ */


remove unused

remove unused

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@16102 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/mdslog.h
+++ slashd/mdslog.h
@@ -82,9 +82,6 @@
 int	mds_bmap_crc_update(struct bmapc_memb *, struct srm_bmap_crcup *);
 int	mds_inode_addrepl_update(struct slash_inode_handle *, sl_ios_id_t, uint32_t, int);

-#define mds_bmap_repl_update_log(b)	mds_bmap_repl_update((b), 1)
-#define mds_bmap_repl_update_nolog(b)	mds_bmap_repl_update((b), 0)
-
 void	mds_current_txg(uint64_t *);

 void	mds_reserve_slot(void);


Check dicts for null so we don't get lots of warnings.

--- mupdf/pdf_page.c
+++ mupdf/pdf_page.c
@@ -87,11 +87,11 @@
 	fz_obj *obj;

 	obj = fz_dictgets(dict, "Resources");
-	if (pdf_resourcesuseblending(obj))
+	if (fz_isdict(obj) && pdf_resourcesuseblending(obj))
 		return 1;

 	obj = fz_dictgets(dict, "ExtGState");
-	if (pdf_extgstateusesblending(obj))
+	if (fz_isdict(obj) && pdf_extgstateusesblending(obj))
 		return 1;

 	return 0;
@@ -103,7 +103,7 @@
 	fz_obj *obj;

 	obj = fz_dictgets(dict, "Resources");
-	if (pdf_resourcesuseblending(obj))
+	if (fz_isdict(obj) && pdf_resourcesuseblending(obj))
 		return 1;

 	return 0;
@@ -208,7 +208,7 @@
 		return fz_rethrow(error, "cannot load page contents (%d %d R)", fz_tonum(obj), fz_togen(obj));
 	}

-	if (pdf_resourcesuseblending(page->resources))
+	if (page->resources && pdf_resourcesuseblending(page->resources))
 		page->transparency = 1;

 	pdf_logpage("} %p\n", page);


Avoid free() of static default config file filename.

--- myproxy_server.c
+++ myproxy_server.c
@@ -134,11 +134,21 @@

     /* Set context defaults */
     server_context->run_as_daemon = 1;
-    server_context->config_file = default_config_file;

     if (init_arguments(argc, argv, socket_attrs, server_context) < 0) {
         fprintf(stderr, usage);
         exit(1);
+    }
+
+    if (server_context->config_file == NULL)
+    {
+	server_context->config_file = strdup(default_config_file);
+
+	if (server_context->config_file == NULL)
+	{
+	    perror("strdup()");
+	    exit(1);
+	}
     }

     /* Read my configuration */


Fix for bug #31566: my_write(fd, 0x0, 0, flags) fails with EFAULT on
some platforms

Since the behavior of write(fd, buf, 0) is undefined, it may fail with
EFAULT on some architectures when buf == NULL. The error was propagated
up to a caller, since my_write() code did not handle it properly.

Fixed by checking the 'number of bytes' argument in my_write() and
returning before calling the write() system call when there is nothing
to write.

--- mysys/my_write.c
+++ mysys/my_write.c
@@ -29,6 +29,10 @@
 		   Filedes, (long) Buffer, Count, MyFlags));
   errors=0; written=0L;

+  /* The behavior of write(fd, buf, 0) is not portable */
+  if (unlikely(!Count))
+    return 0;
+
   for (;;)
   {
     if ((writenbytes = (uint) write(Filedes, Buffer, Count)) == Count)


Removing compilation warnings.

Removing compilation warnings.

--- native/c/janet.c
+++ native/c/janet.c
@@ -647,11 +647,10 @@
 			    const char *filename, int lineno,
 			    ...) {
     va_list va;
-    jobject obj;
     int i;
     jint lengths[MAX_ARRAY_DEPTH];
     jclass types[MAX_ARRAY_DEPTH];
-    jniNewPrimArrF basef;
+    jniNewPrimArrF basef = 0;

     /* copy parameters from vararg to regular arrays to enable recursion */
     va_start(va, lineno);


[ATM]: Fix for crash in adummy_init()

[ATM]: Fix for crash in adummy_init()

This was reported by Ingo Molnar here,

http://lkml.org/lkml/2006/12/18/119

The problem is that adummy_init() depends on atm_init() , but adummy_init()
is called first.

So I put atm_init() into subsys_initcall which seems appropriate, and it
will still get module_init() if it becomes a module.

Interesting to note that you could crash your system here if you just load
the modules in the wrong order.

Signed-off-by: Daniel Walker <664f14bf9af4dadf8666a74e4a7425b312868d0d@mvista.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/atm/common.c
+++ net/atm/common.c
@@ -816,7 +816,8 @@
 	proto_unregister(&vcc_proto);
 }

-module_init(atm_init);
+subsys_initcall(atm_init);
+
 module_exit(atm_exit);

 MODULE_LICENSE("GPL");


[DCCP]: Set dccp_ctl_socket to NULL in dccp_ctl_sock_exit

Signed-off-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@mandriva.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/dccp/proto.c
+++ net/dccp/proto.c
@@ -506,8 +506,10 @@
 #ifdef CONFIG_IP_DCCP_UNLOAD_HACK
 void dccp_ctl_sock_exit(void)
 {
-	if (dccp_ctl_socket != NULL)
+	if (dccp_ctl_socket != NULL) {
 		sock_release(dccp_ctl_socket);
+		dccp_ctl_socket = NULL;
+	}
 }

 EXPORT_SYMBOL_GPL(dccp_ctl_sock_exit);


ipv6: Initialize the struct rt6_info behind the dst_enty field

We start initializing the struct rt6_info at the first field
behind the struct dst_enty. This is error prone because it
might leave a new field uninitialized. So start initializing
the struct rt6_info right behind the dst_entry.

Suggested-by: Eric Dumazet <a0baddf32b28d2f9429941ed4af2fe636e210591@gmail.com>
Signed-off-by: Steffen Klassert <66deb1d63f85161cc287ce2bac0c65cb5ae958a7@secunet.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/ipv6/route.c
+++ net/ipv6/route.c
@@ -280,8 +280,9 @@
 					0, 0, flags);

 	if (rt) {
-		memset(&rt->n, 0,
-		       sizeof(*rt) - sizeof(struct dst_entry));
+		struct dst_entry *dst = &rt->dst;
+
+		memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
 		rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers);
 	}
 	return rt;
@@ -982,10 +983,10 @@

 	rt = dst_alloc(&ip6_dst_blackhole_ops, ort->dst.dev, 1, 0, 0);
 	if (rt) {
-		memset(&rt->rt6i_table, 0, sizeof(*rt) - sizeof(struct dst_entry));
+		new = &rt->dst;
+
+		memset(new + 1, 0, sizeof(*rt) - sizeof(*new));
 		rt6_init_peer(rt, net->ipv6.peers);
-
-		new = &rt->dst;

 		new->__use = 1;
 		new->input = dst_discard;


net: irda: irttp: sync error paths of data- and udata-requests

irttp_data_request() returns meaningful errorcodes, while irttp_udata_request()
just returns -1 in similar situations. Sync the two and the loglevels of the
accompanying output.

Signed-off-by: Wolfram Sang <3883f8aab0424a154a3bcb43ff874b819786efbe@pengutronix.de>
Cc: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>
Cc: David Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/irda/irttp.c
+++ net/irda/irttp.c
@@ -550,7 +550,7 @@
  */
 int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
 {
-	int ret = -1;
+	int ret;

 	IRDA_ASSERT(self != NULL, return -1;);
 	IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
@@ -566,13 +566,14 @@

 	/* Check that nothing bad happens */
 	if (!self->connected) {
-		IRDA_DEBUG(1, "%s(), Not connected\n", __func__);
+		IRDA_WARNING("%s(), Not connected\n", __func__);
+		ret = -ENOTCONN;
 		goto err;
 	}

 	if (skb->len > self->max_seg_size) {
-		IRDA_DEBUG(1, "%s(), UData is too large for IrLAP!\n",
-			   __func__);
+		IRDA_ERROR("%s(), UData is too large for IrLAP!\n", __func__);
+		ret = -EMSGSIZE;
 		goto err;
 	}


Flush the cached IPv6 forward route every 500 ms.  This prevents wrong checks for local addresses and wrong packet forwarding in environments with only one communication partner and changing addresses or routes.  Remove the #if 0 around the existing code to make IPv6 behave like IPv4. ok henning@

--- netinet6/frag6.c
+++ netinet6/frag6.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: frag6.c,v 1.38 2012/01/09 14:47:53 bluhm Exp $	*/
+/*	$OpenBSD: frag6.c,v 1.39 2012/01/10 12:50:32 bluhm Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/

 /*
@@ -620,6 +620,7 @@
 {
 	struct ip6q *q6, *nq6;
 	int s = splsoftnet();
+	extern struct route_in6 ip6_forward_rt;

 	IP6Q_LOCK();
 	TAILQ_FOREACH_SAFE(q6, &frag6_queue, ip6q_queue, nq6)
@@ -642,7 +643,6 @@
 	}
 	IP6Q_UNLOCK();

-#if 0
 	/*
 	 * Routing changes might produce a better route than we last used;
 	 * make sure we notice eventually, even if forwarding only for one
@@ -652,7 +652,6 @@
 		RTFREE(ip6_forward_rt.ro_rt);
 		ip6_forward_rt.ro_rt = 0;
 	}
-#endif

 	splx(s);
 }


tweak

tweak

git-svn-id: a2d12f8ba5efd9a6cf770ee2a6d40c767093e4df@10198 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- zfs-fuse-0.5.0_slash/src/zfs-fuse/zfs_operations_slash.c
+++ zfs-fuse-0.5.0_slash/src/zfs-fuse/zfs_operations_slash.c
@@ -1501,21 +1501,25 @@
 zfsslash2_link(void *vfsdata, uint64_t ino, uint64_t newparent,
     const char *newname, struct fidgen *fg, cred_t *cred, struct stat *stb)
 {
-	if(strlen(newname) >= MAXNAMELEN) /* XXX off-by-one */
+	vfs_t		*vfs;
+	int		 error;
+	zfsvfs_t	*zfsvfs;
+	znode_t		*s_znode;
+	znode_t		*td_znode;
+
+	if (strlen(newname) >= MAXNAMELEN) /* XXX off-by-one */
 		return ENAMETOOLONG;
-
-	vfs_t *vfs = (vfs_t *) vfsdata;
-	zfsvfs_t *zfsvfs = vfs->vfs_data;

 	if (newparent == 1) newparent = 3;
 	if (ino == 1) ino = 3;

-	ZFS_ENTER(zfsvfs);
-
-	znode_t *td_znode, *s_znode;
-
-	int error = zfs_zget(zfsvfs, ino, &s_znode, B_FALSE);
-	if(error) {
+	vfs = (vfs_t *)vfsdata;
+	zfsvfs = vfs->vfs_data;
+
+	ZFS_ENTER(zfsvfs);
+
+	error = zfs_zget(zfsvfs, ino, &s_znode, B_FALSE);
+	if (error) {
 		ZFS_EXIT(zfsvfs);
 		/* If the inode we are trying to get was recently deleted
 		   dnode_hold_impl will return EEXIST instead of ENOENT */
@@ -1525,7 +1529,7 @@
 	ASSERT(s_znode != NULL);

 	error = zfs_zget(zfsvfs, newparent, &td_znode, B_FALSE);
-	if(error) {
+	if (error) {
 		VN_RELE(ZTOV(s_znode));
 		ZFS_EXIT(zfsvfs);
 		/* If the inode we are trying to get was recently deleted


drop a reference on vnode

drop a reference on vnode

git-svn-id: a2d12f8ba5efd9a6cf770ee2a6d40c767093e4df@10645 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- zfs-fuse-0.5.0_slash/src/zfs-fuse/zfs_operations_slash.c
+++ zfs-fuse-0.5.0_slash/src/zfs-fuse/zfs_operations_slash.c
@@ -634,6 +634,8 @@
 		break;
 	case FIDLINK_REMOVE:
 		error = VOP_REMOVE(vp, (char *)id_name, &zrootcreds, NULL, 0);
+		/* Drop the reference to the directory in which we attempted to remove a link */
+		VN_RELE(vp);
 		break;
 	default:
 		error = EINVAL;


Added missing include of config.h

Added missing include of config.h

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@3369 67ed7778-7388-44ab-90cf-0a291f65f57c

--- libgphoto2_port/libgphoto2_port/gphoto2-port-log.h
+++ libgphoto2_port/libgphoto2_port/gphoto2-port-log.h
@@ -22,6 +22,7 @@
 #define __GPHOTO2_PORT_LOG_H__

 #include <stdarg.h>
+#include <config.h>

 typedef enum {
 	GP_LOG_ERROR = 0,


Use a connection pool within apr_socket_accept().

This makes memory allocation for accepted sockets more predictable and independent from each other. The point is not to use a pool shared among multiple sockets/connections, where the lifetime of the shared pool could theoretically be infinite.

--- libs/mrcpv2-transport/src/mrcp_server_connection.c
+++ libs/mrcpv2-transport/src/mrcp_server_connection.c
@@ -410,12 +410,10 @@
 {
 	APR_RING_REMOVE(connection,link);

-	if(agent->null_connection) {
-		if(APR_RING_EMPTY(&agent->connection_list, mrcp_connection_t, link) && apr_hash_count(agent->null_connection->channel_table) == 0) {
-			apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Destroy Container for Pending Control Channels");
-			mrcp_connection_destroy(agent->null_connection);
-			agent->null_connection = NULL;
-		}
+	if(agent->null_connection && apr_hash_count(agent->null_connection->channel_table) == 0) {
+		apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Destroy Container for Pending Control Channels");
+		mrcp_connection_destroy(agent->null_connection);
+		agent->null_connection = NULL;
 	}
 	return TRUE;
 }
@@ -424,35 +422,19 @@
 {
 	char *local_ip = NULL;
 	char *remote_ip = NULL;
-	apr_socket_t *sock;
-	apr_pool_t *pool;
-	mrcp_connection_t *connection;
-
-	if(!agent->null_connection) {
-		pool = apt_pool_create();
-		if(apr_socket_accept(&sock,agent->listen_sock,pool) != APR_SUCCESS) {
-			apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Accept Connection");
-			return FALSE;
-		}
-		apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Rejected TCP/MRCPv2 Connection");
-		apr_socket_close(sock);
-		apr_pool_destroy(pool);
-		return FALSE;
-	}
-
-	pool = agent->null_connection->pool;
-	if(apr_socket_accept(&sock,agent->listen_sock,pool) != APR_SUCCESS) {
+
+	mrcp_connection_t *connection = mrcp_connection_create();
+
+	if(apr_socket_accept(&connection->sock,agent->listen_sock,connection->pool) != APR_SUCCESS) {
 		apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Accept Connection");
-		return FALSE;
-	}
-
-	connection = mrcp_connection_create();
-	connection->sock = sock;
-
-	if(apr_socket_addr_get(&connection->r_sockaddr,APR_REMOTE,sock) != APR_SUCCESS ||
-		apr_socket_addr_get(&connection->l_sockaddr,APR_LOCAL,sock) != APR_SUCCESS) {
+		mrcp_connection_destroy(connection);
+		return FALSE;
+	}
+
+	if(apr_socket_addr_get(&connection->r_sockaddr,APR_REMOTE,connection->sock) != APR_SUCCESS ||
+		apr_socket_addr_get(&connection->l_sockaddr,APR_LOCAL,connection->sock) != APR_SUCCESS) {
 		apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Socket Address");
-		apr_socket_close(sock);
+		apr_socket_close(connection->sock);
 		mrcp_connection_destroy(connection);
 		return FALSE;
 	}
@@ -463,6 +445,13 @@
 	connection->id = apr_psprintf(connection->pool,"%s:%hu <-> %s:%hu",
 		local_ip,connection->l_sockaddr->port,
 		remote_ip,connection->r_sockaddr->port);
+
+	if(!agent->null_connection) {
+		apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Reject Unexpected TCP/MRCPv2 Connection %s",connection->id);
+		apr_socket_close(connection->sock);
+		mrcp_connection_destroy(connection);
+		return FALSE;
+	}

 	memset(&connection->sock_pfd,0,sizeof(apr_pollfd_t));
 	connection->sock_pfd.desc_type = APR_POLL_SOCKET;
@@ -471,7 +460,7 @@
 	connection->sock_pfd.client_data = connection;
 	if(apt_poller_task_descriptor_add(agent->task, &connection->sock_pfd) != TRUE) {
 		apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Add to Pollset %s",connection->id);
-		apr_socket_close(sock);
+		apr_socket_close(connection->sock);
 		mrcp_connection_destroy(connection);
 		return FALSE;
 	}
@@ -567,11 +556,9 @@
 			apr_hash_count(connection->channel_table));
 	if(!connection->access_count) {
 		if(connection == agent->null_connection) {
-			if(APR_RING_EMPTY(&agent->connection_list, mrcp_connection_t, link)) {
-				apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Destroy Container for Pending Control Channels");
-				mrcp_connection_destroy(agent->null_connection);
-				agent->null_connection = NULL;
-			}
+			apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Destroy Container for Pending Control Channels");
+			mrcp_connection_destroy(agent->null_connection);
+			agent->null_connection = NULL;
 		}
 		else if(!connection->sock) {
 			mrcp_connection_remove(agent,connection);


Return error when trying to decoding an interlaced VC-1 video

https://bugs.freedesktop.org/show_bug.cgi?id=77386

Signed-off-by: Xiang, Haihao <8d677183e5993577d4fa73a419b76987913292d6@intel.com>
Reviewed-by: Zhao Yakui <21bae65ecea50a19bd9d0fef489914760189fd5b@intel.com>

--- src/i965_decoder_utils.c
+++ src/i965_decoder_utils.c
@@ -654,7 +654,12 @@
     VAPictureParameterBufferVC1 *pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
     struct object_surface *obj_surface;
     int i = 0;
-
+
+    if (pic_param->sequence_fields.bits.interlace == 1 &&
+        pic_param->picture_fields.bits.frame_coding_mode != 0) { /* frame-interlace or field-interlace */
+        return VA_STATUS_ERROR_DECODING_ERROR;
+    }
+
     if (pic_param->picture_fields.bits.picture_type == 0 ||
         pic_param->picture_fields.bits.picture_type == 3) {
     } else if (pic_param->picture_fields.bits.picture_type == 1 ||


**

git-svn-id: 6c610409e58ede315c0bda6914ef7fcf172715a2@273242 73f437aa-624d-0410-a3ad-9285e900ec26

--- src/include/clusterlib.h
+++ src/include/clusterlib.h
@@ -1,4 +1,4 @@
-/*
+/**
  * $Id$
  *
  * $Copyright$


removed commented out code

removed commented out code

--- src/include/obj_policy.h
+++ src/include/obj_policy.h
@@ -122,7 +122,6 @@
 TSS_RESULT obj_policy_flush_secret(TSS_HPOLICY);
 TSS_RESULT obj_policy_set_secret_object(TSS_HPOLICY, TSS_FLAG, UINT32,
 					TCPA_DIGEST *, TSS_BOOL);
-//TSS_RESULT obj_policy_copy_secret(TSS_HPOLICY, TSS_HPOLICY);
 TSS_RESULT obj_policy_set_secret(TSS_HPOLICY, TSS_FLAG, UINT32, BYTE *);
 TSS_RESULT obj_policy_get_type(TSS_HPOLICY, UINT32 *);
 TSS_RESULT obj_policy_remove(TSS_HOBJECT, TSS_HCONTEXT);
@@ -153,11 +152,7 @@
 TSS_RESULT obj_policy_get_hash_mode(TSS_HCONTEXT, UINT32 *);
 TSS_RESULT obj_policy_set_hash_mode(TSS_HCONTEXT, UINT32);
 TSS_RESULT obj_policy_get_osap_params(TSS_HCONTEXT, BYTE *, TSS_CALLBACK *, TSS_CALLBACK *,
-				      UINT32 *);
-#ifdef TSS_BUILD_SEALX
-TSS_RESULT obj_policy_do_sealx_mask(TSS_HPOLICY, TSS_HKEY, TSS_HENCDATA, TPM_AUTH *,
-		TPM_NONCE *, TPM_NONCE *, UINT32, BYTE *, BYTE **);
-#endif
+				      TSS_CALLBACK *, UINT32 *);
 #ifdef TSS_BUILD_DELEGATION
 TSS_RESULT obj_policy_set_delegation_type(TSS_HPOLICY, UINT32);
 TSS_RESULT obj_policy_get_delegation_type(TSS_HPOLICY, UINT32 *);


Fix #elif typo.

Fix #elif typo.

--- src/include/port/linux.h
+++ src/include/port/linux.h
@@ -43,7 +43,7 @@

 #define HAS_TEST_AND_SET

-#ifif defined(__m68k__)
+#elif defined(__m68k__)
 typedef unsigned char slock_t;

 #define HAS_TEST_AND_SET


Fix T53349: AO bounces not working correct with OpenCL

--- src/kernel/kernel_path.h
+++ src/kernel/kernel_path.h
@@ -59,6 +59,11 @@
 {
 	uint visibility = path_state_ray_visibility(kg, state);

+	if(path_state_ao_bounce(kg, state)) {
+		visibility = PATH_RAY_SHADOW;
+		ray->t = kernel_data.background.ao_distance;
+	}
+
 #ifdef __HAIR__
 	float difl = 0.0f, extmax = 0.0f;
 	uint lcg_state = 0;
@@ -72,11 +77,6 @@

 		extmax = kernel_data.curve.maximum_width;
 		lcg_state = lcg_state_init_addrspace(state, 0x51633e2d);
-	}
-
-	if(path_state_ao_bounce(kg, state)) {
-		visibility = PATH_RAY_SHADOW;
-		ray->t = kernel_data.background.ao_distance;
 	}

 	bool hit = scene_intersect(kg, *ray, visibility, isect, &lcg_state, difl, extmax);


launcher/Launcher: changed uri names

launcher/Launcher: changed uri names

--- src/launcher/qlauncher.h
+++ src/launcher/qlauncher.h
@@ -47,8 +47,8 @@
 {
     Q_OBJECT
     Q_INTERFACES(QQmlParserStatus)
-    Q_PROPERTY(QString commandUri READ commandUri WRITE setCommandUri NOTIFY commandUriChanged)
-    Q_PROPERTY(QString subscribeUri READ subscribeUri WRITE setSubscribeUri NOTIFY subscribeUriChanged)
+    Q_PROPERTY(QString launchercmdUri READ launchercmdUri WRITE setLaunchercmdUri NOTIFY launchercmdUriChanged)
+    Q_PROPERTY(QString launcherUri READ launcherUri WRITE setLauncherUri NOTIFY launcherUriChanged)
     Q_PROPERTY(int heartbeatPeriod READ heartbeatPeriod WRITE heartbeatPeriod NOTIFY heartbeatPeriodChanged)
     Q_PROPERTY(bool connected READ isConnected NOTIFY connectedChanged)
     Q_PROPERTY(Service::State connectionState READ connectionState NOTIFY connectionStateChanged)
@@ -61,12 +61,12 @@
     explicit QLauncher(QObject *parent = 0);
     ~QLauncher();

-    QString commandUri() const
+    QString launchercmdUri() const
     {
         return m_commandUri;
     }

-    QString subscribeUri() const
+    QString launcherUri() const
     {
         return m_subscribeUri;
     }
@@ -107,22 +107,22 @@
     }

 public slots:
-    void setCommandUri(QString arg)
+    void setLaunchercmdUri(QString arg)
     {
         if (m_commandUri == arg)
             return;

         m_commandUri = arg;
-        emit commandUriChanged(arg);
-    }
-
-    void setSubscribeUri(QString arg)
+        emit launchercmdUriChanged(arg);
+    }
+
+    void setLauncherUri(QString arg)
     {
         if (m_subscribeUri == arg)
             return;

         m_subscribeUri = arg;
-        emit subscribeUriChanged(arg);
+        emit launcherUriChanged(arg);
     }

     void heartbeatPeriod(int arg)
@@ -194,8 +194,8 @@
     void unsubscribe(const QString &topic);

 signals:
-    void commandUriChanged(QString arg);
-    void subscribeUriChanged(QString arg);
+    void launchercmdUriChanged(QString arg);
+    void launcherUriChanged(QString arg);
     void heartbeatPeriodChanged(int arg);
     void connectedChanged(bool arg);
     void connectionStateChanged(Service::State arg);


lib-dns: Added DNS_CLIENT_SOCKET_NAME macro for the default socket name.

--- src/lib-dns/dns-lookup.h
+++ src/lib-dns/dns-lookup.h
@@ -1,5 +1,7 @@
 #ifndef DNS_LOOKUP_H
 #define DNS_LOOKUP_H
+
+#define DNS_CLIENT_SOCKET_NAME "dns-client"

 struct dns_lookup;


efm_monitor: delete listen monitor correctly

--- src/lib/efm/fm_monitor.c
+++ src/lib/efm/fm_monitor.c
@@ -34,9 +34,9 @@
 }

 void
-fm_monitor_del(Efm_Monitor *mon, Eio_Monitor *monitor)
+fm_monitor_del(Efm_Monitor *mon EINA_UNUSED, Eio_Monitor *monitor)
 {
-  eina_hash_del(ctx->open_monitors, &monitor, mon);
+   eina_hash_del(ctx->open_monitors, &monitor, NULL);
 }


Add support for file:/// URIs in cut and paste and persistent URIs/

Patch original from Hyoyoung Chang.
Modified by me a lot, with some extra debug.
Also I removed the sizeof(char).  That was defined to be one before most of us
where born.

SVN revision: 55986

--- src/lib/elm_cnp_helper.c
+++ src/lib/elm_cnp_helper.c
@@ -11,6 +11,7 @@
 #define ARRAYINIT(foo)  [foo] =

 //#define DEBUGON 1
+

 #ifdef DEBUGON
 # define cnp_debug(x...) fprintf(stderr, __FILE__": " x)
@@ -1073,9 +1074,9 @@
    if (file)
      {
         if (strstr(file,"file://")) file += prefixlen;
-        filebuf = alloca(sizeof(char) * (pathlen - prefixlen + 1));
-        strncpy(filebuf, file, pathlen - prefixlen);
-        filebuf[pathlen-prefixlen] = '\0';
+        filebuf = alloca(pathlen + 1);
+        strncpy(filebuf, file, pathlen);
+        filebuf[pathlen] = 0;
         pi->file = strdup(filebuf);
      }

@@ -1117,16 +1118,20 @@
 static Eina_Bool
 pasteimage_append(Paste_Image *pi, Evas_Object *entry)
 {
-   char entrytag[256];
-
+   char *entrytag;
+   int len;
+   static const char *tagstring = "<item absize=240x180 href=file://%s></item>";
+
    if (!pi) return EINA_FALSE;
    if (!entry) return EINA_FALSE;

    pasteimage_provider_set(entry);

+   len = strlen(tagstring)+strlen(pi->file);
+
    pastedimages = eina_list_append(pastedimages, pi);
-   snprintf(entrytag, sizeof(entrytag),
-            "<item absize=240x180 href=%s>", pi->tag);
+   entrytag = alloca(len + 1);
+   snprintf(entrytag, len + 1, tagstring, pi->file);
    elm_entry_entry_insert(entry, entrytag);

    return EINA_TRUE;
@@ -1344,11 +1349,14 @@

    if (i == CNP_ATOM_text_urilist)
      {
-        cnp_debug("We found a URI... (%scached)\n", savedtypes.pi ? "" : "not ");
+        cnp_debug("We found a URI... (%scached) %s\n",
+                  savedtypes.pi ? "" : "not ",
+                  savedtypes.pi->file);
         if (savedtypes.pi)
           {
-             char entrytag[100];
-
+             char *entrytag;
+             static const char *tagstring = "<item absize=240x180 href="
+                                                   "file://%s></item>";
              ddata.x = savedtypes.x;
              ddata.y = savedtypes.y;

@@ -1359,26 +1367,31 @@
                   ddata.data = (char *)savedtypes.pi->file;
                   dropable->dropcb(dropable->cbdata, dropable->obj, &ddata);
                   ecore_x_dnd_send_finished();
-
+
                   pasteimage_free(savedtypes.pi);
                   savedtypes.pi = NULL;
-
+
                   return EINA_TRUE;
                }
              else if (dropable->types & ELM_SEL_FORMAT_MARKUP)
                {
+                  int len;
                   ddata.format = ELM_SEL_FORMAT_MARKUP;
                   pasteimage_provider_set(dropable->obj);
-
+
                   pastedimages = eina_list_append(pastedimages, savedtypes.pi);
-                  snprintf(entrytag, sizeof(entrytag),
-                           "<item absize=240x180 href=%s>",
-                           savedtypes.pi->tag);
+                  len = strlen(tagstring) + strlen(savedtypes.pi->file);
+                  entrytag = alloca(len + 1);
+                  snprintf(entrytag, len + 1, tagstring, savedtypes.pi->file);
                   ddata.data = entrytag;
                   cnp_debug("Insert %s\n", (char *)ddata.data);
                   dropable->dropcb(dropable->cbdata, dropable->obj, &ddata);
                   ecore_x_dnd_send_finished();
                   return EINA_TRUE;
+               }
+             else
+               {
+                  cnp_debug("Umm,, dropped that\n");
                }
           }
         else if (savedtypes.textreq)


istream-concat: Avoid assert-crashing.

istream-concat: Avoid assert-crashing.

--- src/lib/istream-concat.c
+++ src/lib/istream-concat.c
@@ -70,9 +70,12 @@
 	/* we already verified that the data size is less than the
 	   maximum buffer size */
 	cstream->istream.pos = 0;
-	if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))
-		i_unreached();
-	i_assert(size >= data_size);
+	if (data_size > 0) {
+		if (!i_stream_get_buffer_space(&cstream->istream,
+					       data_size, &size))
+			i_unreached();
+		i_assert(size >= data_size);
+	}

 	cstream->prev_stream_left = data_size;
 	memcpy(cstream->istream.w_buffer, data, data_size);


wrong inheritance

wrong inheritance

--- src/lib/nestedloopjoin.h
+++ src/lib/nestedloopjoin.h
@@ -8,7 +8,8 @@
 namespace annis
 {

-class NestedLoopJoin : public BinaryMatch
+/** A join that checks all combinations of the left and right matches if their are connected. */
+class NestedLoopJoin : public BinaryOperatorIterator
 {
 public:
   NestedLoopJoin(const EdgeDB* edb, AnnotationIterator &left, AnnotationIterator &right,


Add comment.

Add comment.

--- src/libcol/types/tuple.c
+++ src/libcol/types/tuple.c
@@ -106,6 +106,10 @@
     return result;
 }

+/*
+ * XXX: The extra copy here is unfortunate. One easy fix would be to avoid
+ * the sbuf_dup() and simply return the malloc'd string.
+ */
 char *
 tuple_to_str(Tuple *tuple, apr_pool_t *pool)
 {


fix setname methods to not do anything if name is locked

--- src/libelektra/keyname.c
+++ src/libelektra/keyname.c
@@ -801,7 +801,7 @@
 {
 	if (!key) return -1;
 	if (!baseName) return key->keySize;
-	// if (test_bit(key->flags,  KEY_FLAG_RO_NAME)) return -1;
+	if (test_bit(key->flags,  KEY_FLAG_RO_NAME)) return -1;
 	if (!key->key) return -1;

 	size_t size=0;
@@ -833,13 +833,14 @@
  * @retval -1 if key is a null pointer or did not have a valid name before
  * @retval -1 if newName is a null pointer or not a valid name (contains \\ in beginning)
  * @retval -1 on allocation errors
+ * @retval -1 if key was inserted to a keyset before
  * @retval size of the new key
  */
 ssize_t keyAddName(Key *key, const char *newName)
 {
 	if (!key) return -1;
 	if (!newName) return key->keySize;
-	// if (test_bit(key->flags,  KEY_FLAG_RO_NAME)) return -1;
+	if (test_bit(key->flags,  KEY_FLAG_RO_NAME)) return -1;
 	// if (!elektraValidateKeyNamePart(newName)) return -1;
 	if (!key->key) return -1;

@@ -932,6 +933,7 @@
 	if (!key) return -1;

 	if (!key->key) return -1;
+	if (test_bit(key->flags,  KEY_FLAG_RO_NAME)) return -1;

 	if (!baseName)
 	{


card-npa: fixed memory leak

card-npa: fixed memory leak

fixes https://github.com/OpenSC/OpenSC/issues/1396

--- src/libopensc/card-npa.c
+++ src/libopensc/card-npa.c
@@ -351,6 +351,18 @@
 	return r;
 }

+static int npa_finish(sc_card_t * card)
+{
+	sc_sm_stop(card);
+	npa_drv_data_free(card->drv_data);
+	card->drv_data = NULL;
+#ifdef ENABLE_OPENPACE
+	EAC_cleanup();
+#endif
+
+	return SC_SUCCESS;
+}
+
 static int npa_init(sc_card_t * card)
 {
 	int flags = SC_ALGORITHM_ECDSA_RAW;
@@ -392,6 +404,7 @@
 #endif
 	card->drv_data = npa_drv_data_create();
 	if (!card->drv_data) {
+		npa_finish(card);
 		r = SC_ERROR_OUT_OF_MEMORY;
 		goto err;
 	}
@@ -407,18 +420,6 @@

 err:
 	return r;
-}
-
-static int npa_finish(sc_card_t * card)
-{
-	sc_sm_stop(card);
-	npa_drv_data_free(card->drv_data);
-	card->drv_data = NULL;
-#ifdef ENABLE_OPENPACE
-	EAC_cleanup();
-#endif
-
-	return SC_SUCCESS;
 }

 static int npa_set_security_env(struct sc_card *card,


removed unused comparison

removed unused comparison

--- src/libopensc/card-piv.c
+++ src/libopensc/card-piv.c
@@ -2487,36 +2487,34 @@
 		if (r < 0)
 			goto err;

-		if ( r >= 0) {
-			body = sc_asn1_find_tag(card->ctx, rbuf, rbuflen, 0x30, &bodylen);
-
-			for (i = 0; i<2; i++) {
-				if (body) {
-					tag = sc_asn1_find_tag(card->ctx, body,  bodylen, 0x02, &taglen);
-					if (tag) {
-						bodylen -= taglen - (tag - body);
-						body = tag + taglen;
-
-						if (taglen > nLen) { /* drop leading 00 if present */
-							if (*tag != 0x00) {
-								r = SC_ERROR_INVALID_DATA;
-								goto err;
-							}
-							tag++;
-							taglen--;
+		body = sc_asn1_find_tag(card->ctx, rbuf, rbuflen, 0x30, &bodylen);
+
+		for (i = 0; i<2; i++) {
+			if (body) {
+				tag = sc_asn1_find_tag(card->ctx, body,  bodylen, 0x02, &taglen);
+				if (tag) {
+					bodylen -= taglen - (tag - body);
+					body = tag + taglen;
+
+					if (taglen > nLen) { /* drop leading 00 if present */
+						if (*tag != 0x00) {
+							r = SC_ERROR_INVALID_DATA;
+							goto err;
 						}
-						memcpy(out + nLen*i + nLen - taglen , tag, taglen);
-					} else {
-						r = SC_ERROR_INVALID_DATA;
-						goto err;
+						tag++;
+						taglen--;
 					}
-				} else  {
+					memcpy(out + nLen*i + nLen - taglen , tag, taglen);
+				} else {
 					r = SC_ERROR_INVALID_DATA;
 					goto err;
 				}
+			} else  {
+				r = SC_ERROR_INVALID_DATA;
+				goto err;
 			}
-			r = 2 * nLen;
-		}
+		}
+		r = 2 * nLen;
 	} else { /* RSA is all set */
 		r = piv_validate_general_authentication(card, data, datalen, out, outlen);
 	}


debug output

debug output

--- src/libraries/libeinit.c
+++ src/libraries/libeinit.c
@@ -143,6 +143,8 @@

  if (!einit_ipc_address || !einit_ipc_address[0])
   einit_ipc_address = "unix!/dev/einit-9p";
+
+ fprintf (stderr, "connecting to: %s", einit_ipc_address);

 // einit_ipc_9p_fd = ixp_dial (einit_ipc_address);
  if (priv) {


mount: do not overflow mountpoint allocation

--- src/libs/elektra/mount.c
+++ src/libs/elektra/mount.c
@@ -557,7 +557,8 @@

 	/* 20 is enough for any of the combinations below. */
 	size_t nameSize = keyGetNameSize (backend->mountpoint);
-	char * mountpoint = elektraMalloc (nameSize + 20);
+	size_t allocSize = nameSize + 20;
+	char * mountpoint = elektraMalloc (allocSize);

 	if (!strcmp (keyName (backend->mountpoint), "/"))
 	{
@@ -568,25 +569,25 @@
 			switch (ns)
 			{
 			case KEY_NS_SPEC:
-				sprintf (mountpoint, "spec:%s", keyName (backend->mountpoint));
+				snprintf (mountpoint, allocSize, "spec:%s", keyName (backend->mountpoint));
 				kdb->trie = trieInsert (kdb->trie, mountpoint, backend);
 				splitAppend (kdb->split, backend, keyNew ("spec:/", KEY_VALUE, "root", KEY_END), 2);
 				++backend->refcounter;
 				break;
 			case KEY_NS_DIR:
-				sprintf (mountpoint, "dir:%s", keyName (backend->mountpoint));
+				snprintf (mountpoint, allocSize, "dir:%s", keyName (backend->mountpoint));
 				kdb->trie = trieInsert (kdb->trie, mountpoint, backend);
 				splitAppend (kdb->split, backend, keyNew ("dir:/", KEY_VALUE, "root", KEY_END), 2);
 				++backend->refcounter;
 				break;
 			case KEY_NS_USER:
-				sprintf (mountpoint, "user:%s", keyName (backend->mountpoint));
+				snprintf (mountpoint, allocSize, "user:%s", keyName (backend->mountpoint));
 				kdb->trie = trieInsert (kdb->trie, mountpoint, backend);
 				splitAppend (kdb->split, backend, keyNew ("user:/", KEY_VALUE, "root", KEY_END), 2);
 				++backend->refcounter;
 				break;
 			case KEY_NS_SYSTEM:
-				sprintf (mountpoint, "system:%s", keyName (backend->mountpoint));
+				snprintf (mountpoint, allocSize, "system:%s", keyName (backend->mountpoint));
 				kdb->trie = trieInsert (kdb->trie, mountpoint, backend);
 				splitAppend (kdb->split, backend, keyNew ("system:/", KEY_VALUE, "root", KEY_END), 2);
 				++backend->refcounter;


Fix more issues in the new re cache

Fix more issues in the new re cache

--- src/libserver/re_cache.c
+++ src/libserver/re_cache.c
@@ -76,7 +76,6 @@
 	GHashTableIter it;
 	gpointer k, v;
 	struct rspamd_re_class *re_class;
-	guint i;

 	g_assert (cache != NULL);
 	g_hash_table_iter_init (&it, cache->re_classes);
@@ -140,7 +139,7 @@
 	 */
 	rspamd_regexp_set_cache_id (re, cache->nre ++);
 	nre = rspamd_regexp_ref (re);
-	g_hash_table_insert (re_class->re, re, re);
+	g_hash_table_insert (re_class->re, nre, nre);
 }

 void
@@ -169,7 +168,10 @@
 		src = g_hash_table_lookup (re_class->re, what);

 		if (src) {
-			g_hash_table_replace (re_class->re, what, with);
+			/*
+			 * On calling of this function, we actually unref old re
+			 */
+			g_hash_table_insert (re_class->re, what, rspamd_regexp_ref (with));
 		}
 	}
 }
@@ -182,7 +184,6 @@
 	struct rspamd_re_class *re_class;
 	rspamd_cryptobox_hash_state_t st;
 	rspamd_regexp_t *re;
-	guint i;
 	guchar hash_out[rspamd_cryptobox_HASHBYTES];

 	g_assert (cache != NULL);
@@ -285,7 +286,7 @@
 		/* Get list of specified headers */
 		headerlist = rspamd_message_get_header (task,
 				re_class->type_data,
-				FALSE);
+				is_strong);

 		if (headerlist) {
 			cur = headerlist;
@@ -451,6 +452,9 @@
 					rspamd_regexp_get_pattern (re));
 			return 0;
 		}
+
+		return rspamd_re_cache_exec_re (task, rt, re, re_class, re_id,
+				is_strong, is_multiple);
 	}

 	return 0;


start dumping zones

start dumping zones

--- src/libtorque/topology.c
+++ src/libtorque/topology.c
@@ -68,20 +68,48 @@
 // development code
 #include <stdio.h>

+static int
+print_cpuset(cpu_set_t *cs){
+	unsigned z;
+	int r = 0;
+
+	for(z = 0 ; z < CPU_SETSIZE ; ++z){
+		if(CPU_ISSET(z,cs)){
+			int ret;
+
+			if((ret = printf("%u ",z)) < 0){
+				return -1;
+			}
+			r += ret;
+		}
+	}
+	return r;
+}
+
 int print_topology(void){
-   unsigned z;
+	struct sgroup *s;
+	unsigned z;

-   for(z = 0 ; z < sizeof(affinityid_map) / sizeof(*affinityid_map) ; ++z){
-           if(CPU_ISSET(z,&validmap)){
-		   const libtorque_cput *cpu;
+	s = sched_zone;
+	while(s){
+		printf("Zone %u: ",s->groupid);
+		if(print_cpuset(&s->schedulable) < 0){
+			return -1;
+		}
+		printf("\n");
+		s = s->next;
+	}
+	for(z = 0 ; z < sizeof(affinityid_map) / sizeof(*affinityid_map) ; ++z){
+		if(CPU_ISSET(z,&validmap)){
+			const libtorque_cput *cpu;

-		   if((cpu = libtorque_cpu_getdesc(affinityid_map[z])) == NULL){
-			   return -1;
-		   }
-                   printf("Cpuset ID %u: Type %u, SMT %u Core %u Package %u\n",z,
-                           affinityid_map[z] + 1,cpu_map[z].thread + 1,
-			   cpu_map[z].core + 1,cpu_map[z].package + 1);
-           }
-   }
-   return 0;
+			if((cpu = libtorque_cpu_getdesc(affinityid_map[z])) == NULL){
+				return -1;
+			}
+			printf("Cpuset ID %u: Type %u, SMT %u Core %u Package %u\n",z,
+				affinityid_map[z] + 1,cpu_map[z].thread + 1,
+				cpu_map[z].core + 1,cpu_map[z].package + 1);
+		}
+	}
+	return 0;
 }


libxl: fix resource leaks in libxlDomainStart error paths

libxlDomainStart allocates and reserves resources that were not
being released in error paths. libxlDomainCleanup already handles
the job of releasing resources, and libxlDomainStart should call
it when encountering a failure.

Change the error handling logic to call libxlDomainCleanup on
failure. This includes acquiring the lease sooner and allowing
it to be released in libxlDomainCleanup on failure, similar to
the way other resources are reclaimed. With the lease now
released in libxlDomainCleanup, the release_dom label can be
renamed to cleanup_dom to better reflect its changed semantics.

Signed-off-by: Jim Fehlig <39929b5b86d72d51fceac59b52303e3fe8a3083e@suse.com>

--- src/libxl/libxl_domain.c
+++ src/libxl/libxl_domain.c
@@ -1036,17 +1036,6 @@
                                     vm, true) < 0)
         goto cleanup;

-    if (libxlBuildDomainConfig(driver->reservedGraphicsPorts, vm->def,
-                               cfg->ctx, &d_config) < 0)
-        goto cleanup;
-
-    if (cfg->autoballoon && libxlDomainFreeMem(cfg->ctx, &d_config) < 0)
-        goto cleanup;
-
-    if (virHostdevPrepareDomainDevices(hostdev_mgr, LIBXL_DRIVER_NAME,
-                                       vm->def, VIR_HOSTDEV_SP_PCI) < 0)
-        goto cleanup;
-
     if (virDomainLockProcessStart(driver->lockManager,
                                   "xen:///system",
                                   vm,
@@ -1060,6 +1049,17 @@
                                   priv->lockState) < 0)
         goto cleanup;
     VIR_FREE(priv->lockState);
+
+    if (libxlBuildDomainConfig(driver->reservedGraphicsPorts, vm->def,
+                               cfg->ctx, &d_config) < 0)
+        goto cleanup_dom;
+
+    if (cfg->autoballoon && libxlDomainFreeMem(cfg->ctx, &d_config) < 0)
+        goto cleanup_dom;
+
+    if (virHostdevPrepareDomainDevices(hostdev_mgr, LIBXL_DRIVER_NAME,
+                                       vm->def, VIR_HOSTDEV_SP_PCI) < 0)
+        goto cleanup_dom;

     /* Unlock virDomainObj while creating the domain */
     virObjectUnlock(vm);
@@ -1091,7 +1091,7 @@
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("libxenlight failed to restore domain '%s'"),
                            d_config.c_info.name);
-        goto release_dom;
+        goto cleanup_dom;
     }

     /*
@@ -1152,8 +1152,8 @@
     vm->def->id = -1;
     virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_FAILED);

- release_dom:
-    virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState);
+ cleanup_dom:
+    libxlDomainCleanup(driver, vm);

  cleanup:
     libxl_domain_config_dispose(&d_config);


libxl: convert DefineXMLFlags to use begin/end API pattern

Similar to other uses of virDomainObjListAdd, on success add a ref to the
virDomainObj so that virDomainObjEndAPI can be called as usual.

Signed-off-by: Jim Fehlig <39929b5b86d72d51fceac59b52303e3fe8a3083e@suse.com>
Reviewed-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>

--- src/libxl/libxl_driver.c
+++ src/libxl/libxl_driver.c
@@ -2794,6 +2794,7 @@
                                    &oldDef)))
         goto cleanup;

+    virObjectRef(vm);
     def = NULL;
     vm->persistent = 1;

@@ -2801,7 +2802,7 @@
                             cfg->caps,
                             vm->newDef ? vm->newDef : vm->def) < 0) {
         virDomainObjListRemove(driver->domains, vm);
-        vm = NULL;
+        virObjectLock(vm);
         goto cleanup;
     }

@@ -2815,8 +2816,7 @@
  cleanup:
     virDomainDefFree(def);
     virDomainDefFree(oldDef);
-    if (vm)
-        virObjectUnlock(vm);
+    virDomainObjEndAPI(&vm);
     if (event)
         libxlDomainEventQueue(driver, event);
     virObjectUnref(cfg);


missing header added

missing header added

--- src/lilypond/utilities.h
+++ src/lilypond/utilities.h
@@ -23,6 +23,7 @@
 #include <list>
 #include <algorithm>
 #include <ctime>
+#include <functional>

 #include "smartpointer.h"
 #include "basevisitor.h"


change cinttypes to cstdint

change cinttypes to cstdint

--- src/lv5/runtime_number.h
+++ src/lv5/runtime_number.h
@@ -3,7 +3,7 @@
 #include <cstdlib>
 #include <tr1/array>
 #include <tr1/cstdio>
-#include <tr1/cinttypes>
+#include <tr1/cstdint>
 #include "conversions.h"
 #include "platform_math.h"
 #include "lv5/error_check.h"


fix from errata part 2

fix from errata part 2

--- src/lv5/runtime_object.h
+++ src/lv5/runtime_object.h
@@ -417,8 +417,15 @@
 // section 15.2.4.2 Object.prototype.toString()
 inline JSVal ObjectToString(const Arguments& args, Error* error) {
   CONSTRUCTOR_CHECK("Object.prototype.toString", args, error);
+  const JSVal& this_binding = args.this_binding();
+  if (this_binding.IsUndefined()) {
+    return JSString::NewAsciiString(args.ctx(), "[object Undefined]");
+  }
+  if (this_binding.IsNull()) {
+    return JSString::NewAsciiString(args.ctx(), "[object Null]");
+  }
   std::string ascii;
-  JSObject* const obj = args.this_binding().ToObject(args.ctx(), ERROR(error));
+  JSObject* const obj = this_binding.ToObject(args.ctx(), ERROR(error));
   JSString* const cls = obj->cls();
   assert(cls);
   std::string str("[object ");


revert accidentally deleted lv_img_buf_set_px_color

--- src/lv_draw/lv_img_buf.c
+++ src/lv_draw/lv_img_buf.c
@@ -213,6 +213,68 @@
     } else if(dsc->header.cf == LV_IMG_CF_ALPHA_8BIT) {
         uint32_t px = dsc->header.w * y + x;
         buf_u8[px]  = opa;
+    }
+}
+
+/**
+ * Set the color of a pixel of an image. The alpha channel won't be affected.
+ * @param dsc pointer to an image descriptor
+ * @param x x coordinate of the point to set
+ * @param y x coordinate of the point to set
+ * @param c color of the point
+ * @param safe true: check out of bounds
+ */
+void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)
+{
+    uint8_t * buf_u8 = (uint8_t *)dsc->data;
+
+    if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) {
+        uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3;
+        uint32_t px     = dsc->header.w * y * px_size + x * px_size;
+        memcpy(&buf_u8[px], &c, px_size);
+    } else if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA) {
+        uint8_t px_size = lv_img_cf_get_px_size(dsc->header.cf) >> 3;
+        uint32_t px     = dsc->header.w * y * px_size + x * px_size;
+        memcpy(&buf_u8[px], &c, px_size - 1); /*-1 to not overwrite the alpha value*/
+    } else if(dsc->header.cf == LV_IMG_CF_INDEXED_1BIT) {
+        buf_u8 += sizeof(lv_color32_t) * 2; /*Skip the palette*/
+
+        uint8_t bit = x & 0x7;
+        x           = x >> 3;
+
+        /* Get the current pixel.
+         * dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned
+         * so the possible real width are 8 ,16, 24 ...*/
+        uint32_t px = ((dsc->header.w + 7) >> 3) * y + x;
+        buf_u8[px]  = buf_u8[px] & ~(1 << (7 - bit));
+        buf_u8[px]  = buf_u8[px] | ((c.full & 0x1) << (7 - bit));
+    } else if(dsc->header.cf == LV_IMG_CF_INDEXED_2BIT) {
+        buf_u8 += sizeof(lv_color32_t) * 4; /*Skip the palette*/
+        uint8_t bit = (x & 0x3) * 2;
+        x           = x >> 2;
+
+        /* Get the current pixel.
+         * dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned
+         * so the possible real width are 4, 8 ,12 ...*/
+        uint32_t px = ((dsc->header.w + 3) >> 2) * y + x;
+
+        buf_u8[px] = buf_u8[px] & ~(3 << (6 - bit));
+        buf_u8[px] = buf_u8[px] | ((c.full & 0x3) << (6 - bit));
+    } else if(dsc->header.cf == LV_IMG_CF_INDEXED_4BIT) {
+        buf_u8 += sizeof(lv_color32_t) * 16; /*Skip the palette*/
+        uint8_t bit = (x & 0x1) * 4;
+        x           = x >> 1;
+
+        /* Get the current pixel.
+         * dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned
+         * so the possible real width are 2 ,4, 6 ...*/
+        uint32_t px = ((dsc->header.w + 1) >> 1) * y + x;
+        buf_u8[px]  = buf_u8[px] & ~(0xF << (4 - bit));
+        buf_u8[px]  = buf_u8[px] | ((c.full & 0xF) << (4 - bit));
+    } else if(dsc->header.cf == LV_IMG_CF_INDEXED_8BIT) {
+        buf_u8 += sizeof(lv_color32_t) * 256; /*Skip the palette*/
+        uint32_t px = dsc->header.w * y + x;
+        buf_u8[px]  = c.full;
     }
 }


Fix warning

Fix warning

Warning: transfer of control bypasses initialization lv_tabview.c 926

--- src/lv_objx/lv_tabview.c
+++ src/lv_objx/lv_tabview.c
@@ -923,12 +923,14 @@
                 p = ((tabpage->coords.x1 - tabview->coords.x1) * (indic_size + tabs_style->body.padding.inner)) /
                     lv_obj_get_width(tabview);

-                uint16_t id = ext->tab_cur;
-                if(lv_obj_get_base_dir(tabview) == LV_BIDI_DIR_RTL) {
-                    id = (ext->tab_cnt - (id + 1));
+                {
+                    uint16_t id = ext->tab_cur;
+                    if(lv_obj_get_base_dir(tabview) == LV_BIDI_DIR_RTL) {
+                        id = (ext->tab_cnt - (id + 1));
+                    }
+                    lv_obj_set_x(ext->indic, indic_size * id + tabs_style->body.padding.inner * id +
+                                                 indic_style->body.padding.left - p);
                 }
-                lv_obj_set_x(ext->indic, indic_size * id + tabs_style->body.padding.inner * id +
-                                             indic_style->body.padding.left - p);
                 break;
             case LV_TABVIEW_BTNS_POS_LEFT:
             case LV_TABVIEW_BTNS_POS_RIGHT:


PATCH 03/10] mesa: Complete ARB_framebuffer_no_attachments in Mesa core

Implement GL_ARB_framebuffer_no_attachments in Mesa core
 - changes to conditions for framebuffer completenss
 - implement set/get functions for framebuffers for
   new functions in GL_ARB_framebuffer_no_attachments

Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Signed-off-by: Kevin Rogovin <d8afee74b8abfc6d2833cb66b952727b4a7278ed@intel.com>

--- src/mesa/main/fbobject.c
+++ src/mesa/main/fbobject.c
@@ -1156,14 +1156,48 @@
       } else if (att_layer_count > max_layer_count) {
          max_layer_count = att_layer_count;
       }
+
+      /*
+       * The extension GL_ARB_framebuffer_no_attachments places additional
+       * requirement on each attachment. Those additional requirements are
+       * tighter that those of previous versions of GL. In interest of better
+       * compatibility, we will not enforce these restrictions. For the record
+       * those additional restrictions are quoted below:
+       *
+       * "The width and height of image are greater than zero and less than or
+       *  equal to the values of the implementation-dependent limits
+       *  MAX_FRAMEBUFFER_WIDTH and MAX_FRAMEBUFFER_HEIGHT, respectively."
+       *
+       * "If <image> is a three-dimensional texture or a one- or two-dimensional
+       *  array texture and the attachment is layered, the depth or layer count
+       *  of the texture is less than or equal to the implementation-dependent
+       *  limit MAX_FRAMEBUFFER_LAYERS."
+       *
+       * "If image has multiple samples, its sample count is less than or equal
+       *  to the value of the implementation-dependent limit
+       *  MAX_FRAMEBUFFER_SAMPLES."
+       *
+       * The same requirements are also in place for GL 4.5,
+       * Section 9.4.1 "Framebuffer Attachment Completeness", pg 310-311
+       */
    }

    fb->MaxNumLayers = max_layer_count;

    if (numImages == 0) {
-      fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
-      fbo_incomplete(ctx, "no attachments", -1);
-      return;
+      fb->_HasAttachments = false;
+
+      if (!ctx->Extensions.ARB_framebuffer_no_attachments) {
+         fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
+         fbo_incomplete(ctx, "no attachments", -1);
+         return;
+      }
+
+      if (fb->DefaultGeometry.Width == 0 || fb->DefaultGeometry.Height == 0) {
+         fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT;
+         fbo_incomplete(ctx, "no attachments and default width or height is 0", -1);
+         return;
+      }
    }

    if (_mesa_is_desktop_gl(ctx) && !ctx->Extensions.ARB_ES2_compatibility) {
@@ -1228,8 +1262,10 @@
        * renderbuffers/textures are different sizes, the framebuffer
        * width/height will be set to the smallest width/height.
        */
-      fb->Width = minWidth;
-      fb->Height = minHeight;
+      if (numImages != 0) {
+         fb->Width = minWidth;
+         fb->Height = minHeight;
+      }

       /* finally, update the visual info for the framebuffer */
       _mesa_update_framebuffer_visual(ctx, fb);
@@ -1335,32 +1371,129 @@
    bind_renderbuffer(target, renderbuffer, true);
 }

+static void
+framebuffer_parameteri(struct gl_context *ctx, struct gl_framebuffer *fb,
+                       GLenum pname, GLint param, const char *func)
+{
+   switch (pname) {
+   case GL_FRAMEBUFFER_DEFAULT_WIDTH:
+      if (param < 0 || param > ctx->Const.MaxFramebufferWidth)
+        _mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
+      else
+         fb->DefaultGeometry.Width = param;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_HEIGHT:
+      if (param < 0 || param > ctx->Const.MaxFramebufferHeight)
+        _mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
+      else
+         fb->DefaultGeometry.Height = param;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_LAYERS:
+      if (param < 0 || param > ctx->Const.MaxFramebufferLayers)
+        _mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
+      else
+         fb->DefaultGeometry.Layers = param;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
+      if (param < 0 || param > ctx->Const.MaxFramebufferSamples)
+        _mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
+      else
+        fb->DefaultGeometry.NumSamples = param;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:
+      fb->DefaultGeometry.FixedSampleLocations = param;
+      break;
+   default:
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "%s(pname=0x%x)", func, pname);
+   }
+}
+
 void GLAPIENTRY
 _mesa_FramebufferParameteri(GLenum target, GLenum pname, GLint param)
 {
    GET_CURRENT_CONTEXT(ctx);
-
-   (void) target;
-   (void) pname;
-   (void) param;
-
-   _mesa_error(ctx, GL_INVALID_OPERATION,
-               "glFramebufferParameteri not supported "
-               "(ARB_framebuffer_no_attachments not implemented)");
+   struct gl_framebuffer *fb;
+
+   if (!ctx->Extensions.ARB_framebuffer_no_attachments) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glFramebufferParameteriv not supported "
+                  "(ARB_framebuffer_no_attachments not implemented)");
+      return;
+   }
+
+   fb = get_framebuffer_target(ctx, target);
+   if (!fb) {
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "glFramebufferParameteri(target=0x%x)", target);
+      return;
+   }
+
+   /* check framebuffer binding */
+   if (_mesa_is_winsys_fbo(fb)) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glFramebufferParameteri");
+      return;
+   }
+
+   framebuffer_parameteri(ctx, fb, pname, param, "glFramebufferParameteri");
+}
+
+static void
+get_framebuffer_parameteriv(struct gl_context *ctx, struct gl_framebuffer *fb,
+                            GLenum pname, GLint *params, const char *func)
+{
+   switch (pname) {
+   case GL_FRAMEBUFFER_DEFAULT_WIDTH:
+      *params = fb->DefaultGeometry.Width;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_HEIGHT:
+      *params = fb->DefaultGeometry.Height;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_LAYERS:
+      *params = fb->DefaultGeometry.Layers;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
+      *params = fb->DefaultGeometry.NumSamples;
+      break;
+   case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:
+      *params = fb->DefaultGeometry.FixedSampleLocations;
+      break;
+   default:
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "%s(pname=0x%x)", func, pname);
+   }
 }

 void GLAPIENTRY
 _mesa_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params)
 {
    GET_CURRENT_CONTEXT(ctx);
-
-   (void) target;
-   (void) pname;
-   (void) param;
-
-   _mesa_error(ctx, GL_INVALID_OPERATION,
-               "glGetFramebufferParameteriv not supported "
-               "(ARB_framebuffer_no_attachments not implemented)");
+   struct gl_framebuffer *fb;
+
+   if (!ctx->Extensions.ARB_framebuffer_no_attachments) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glGetFramebufferParameteriv not supported "
+                  "(ARB_framebuffer_no_attachments not implemented)");
+      return;
+   }
+
+   fb = get_framebuffer_target(ctx, target);
+   if (!fb) {
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "glGetFramebufferParameteriv(target=0x%x)", target);
+      return;
+   }
+
+   /* check framebuffer binding */
+   if (_mesa_is_winsys_fbo(fb)) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glGetFramebufferParameteriv");
+      return;
+   }
+
+   get_framebuffer_parameteriv(ctx, fb, pname, params,
+                               "glGetFramebufferParameteriv");
 }

@@ -3704,14 +3837,22 @@
                                  GLint param)
 {
    GET_CURRENT_CONTEXT(ctx);
-
-   (void) framebuffer;
-   (void) pname;
-   (void) param;
-
-   _mesa_error(ctx, GL_INVALID_OPERATION,
-               "glNamedFramebufferParameteri not supported "
-               "(ARB_framebuffer_no_attachments not implemented)");
+   struct gl_framebuffer *fb = NULL;
+
+   if (!ctx->Extensions.ARB_framebuffer_no_attachments) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glNamedFramebufferParameteri("
+                  "ARB_framebuffer_no_attachments not implemented)");
+      return;
+   }
+
+   fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
+                                     "glNamedFramebufferParameteri");
+
+   if (fb) {
+      framebuffer_parameteri(ctx, fb, pname, param,
+                             "glNamedFramebufferParameteriv");
+   }
 }

@@ -3720,14 +3861,26 @@
                                      GLint *param)
 {
    GET_CURRENT_CONTEXT(ctx);
-
-   (void) framebuffer;
-   (void) pname;
-   (void) param;
-
-   _mesa_error(ctx, GL_INVALID_OPERATION,
-               "glGetNamedFramebufferParameteriv not supported "
-               "(ARB_framebuffer_no_attachments not implemented)");
+   struct gl_framebuffer *fb;
+
+   if (!ctx->Extensions.ARB_framebuffer_no_attachments) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glNamedFramebufferParameteriv("
+                  "ARB_framebuffer_no_attachments not implemented)");
+      return;
+   }
+
+   if (framebuffer) {
+      fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
+                                        "glGetNamedFramebufferParameteriv");
+   } else {
+      fb = ctx->WinSysDrawBuffer;
+   }
+
+   if (fb) {
+      get_framebuffer_parameteriv(ctx, fb, pname, param,
+                                  "glGetNamedFramebufferParameteriv");
+   }
 }


mesa: move assertion

mesa: move assertion

--- src/mesa/main/fbobject.c
+++ src/mesa/main/fbobject.c
@@ -185,9 +185,9 @@
       att->Texture = NULL;
    }
    if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) {
-      ASSERT(att->Renderbuffer);
       ASSERT(!att->Texture);
-      _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+      _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */
+      ASSERT(!att->Renderbuffer);
    }
    att->Type = GL_NONE;
    att->Complete = GL_TRUE;


mesa: fix a trivial spelling mistake

mesa: fix a trivial spelling mistake

Signed-off-by: Martin Peres <f078f77bcd6141e84e4eefdc58402db4e0e36622@linux.intel.com>
Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>

--- src/mesa/main/feedback.c
+++ src/mesa/main/feedback.c
@@ -89,7 +89,7 @@
    ctx->Feedback.Type = type;
    ctx->Feedback.BufferSize = size;
    ctx->Feedback.Buffer = buffer;
-   ctx->Feedback.Count = 0;	              /* Becaues of this. */
+   ctx->Feedback.Count = 0;	              /* Because of this. */
 }


minor updates to sync w/ XFree86 changes

--- src/mesa/main/glheader.h
+++ src/mesa/main/glheader.h
@@ -1,4 +1,4 @@
-/* $Id: glheader.h,v 1.16 2001/01/08 04:09:41 keithw Exp $ */
+/* $Id: glheader.h,v 1.17 2001/02/09 23:39:02 brianp Exp $ */

 /*
  * Mesa 3-D graphics library
@@ -39,7 +39,11 @@
  * If you touch this file, everything gets recompiled!
  *
  * This file should be included before any other header in the .c files.
+ *
+ * Put compiler/OS/assembly pragmas and macros here to avoid
+ * cluttering other source files.
  */
+

 #ifdef XFree86LOADER
@@ -70,24 +74,11 @@

-
-/*
- * Put compiler/OS/assembly pragmas and macros here to avoid
- * cluttering other source files.
- */
-
-
-
-/*
- * XXX move as many of these pragma's and MS Windows-isms into
- * the new src/glheader.h file.
- */
-
-#if defined(_WIN32) && !defined(__WIN32__)
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
 #	define __WIN32__
 #endif

-#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
 #  pragma warning( disable : 4068 ) /* unknown pragma */
 #  pragma warning( disable : 4710 ) /* function 'foo' not inlined */
 #  pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
@@ -134,7 +125,7 @@

 /* compatability guard so we don't need to change client code */

-#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
+#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) && !defined(__CYGWIN__)
 #if 0
 #	define CALLBACK GLCALLBACK
 typedef void *HGLRC;
@@ -164,7 +155,9 @@
 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
+#if !defined(GLX_USE_MESA)
 #include <gl/mesa_wgl.h>
+#endif
 #endif


mesa: remove WGLAPI macro

mesa: remove WGLAPI macro

WGLAPI was defined in glheader.h but wasn't used anywhere.

Reviewed-by: Matt Turner <789b315743a28dd066a4ba1459c35951c291d8a6@gmail.com>

--- src/mesa/main/glheader.h
+++ src/mesa/main/glheader.h
@@ -31,22 +31,6 @@

 #ifndef GLHEADER_H
 #define GLHEADER_H
-
-
-#ifdef WGLAPI
-#undef WGLAPI
-#endif
-
-
-#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
-#  if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
-#    define WGLAPI __declspec(dllexport)
-#  elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
-#    define WGLAPI __declspec(dllimport)
-#  else /* for use with static link lib build of Win32 edition only */
-#    define WGLAPI __declspec(dllimport)
-#  endif /* _STATIC_MESA support */
-#endif /* WIN32 / CYGWIN bracket */

 #define GL_GLEXT_PROTOTYPES


mesa: handle numSamples=0 in _mesa_test_proxy_teximage()

Should fix the regressions reported in bug 96949.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96949
Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>

--- src/mesa/main/teximage.c
+++ src/mesa/main/teximage.c
@@ -1271,8 +1271,6 @@
 {
    uint64_t bytes, mbytes;

-   assert(numSamples > 0);
-
    if (numLevels > 0) {
       /* Compute total memory for a whole mipmap.  This is the path
        * taken for glTexStorage(GL_PROXY_TEXTURE_x).
@@ -1306,7 +1304,7 @@
    }

    bytes *= _mesa_num_tex_faces(target);
-   bytes *= numSamples;
+   bytes *= MAX2(1, numSamples);

    mbytes = bytes / (1024 * 1024); /* convert to MB */