Preheat oven to 400°.
Heat 1 teaspoon oil in a 10-inch cast-iron skillet over medium-high heat. Add onion; sauté 8 minutes. Add mushrooms, 1/2 teaspoon salt, and garlic, and cook 4 minutes, stirring frequently. Stir in wine, rosemary, and tomato paste; reduce heat to medium, and cook 3 minutes. Stir in tomatoes, and cook until thick (about 10 minutes). Remove from heat.
Bring water to a boil in saucepan; stir in polenta and 1 teaspoon salt. Reduce heat to low; cook until thick (about 5 minutes), stirring frequently.
Spread one-third of polenta mixture into a 13 x 9-inch baking dish coated with 1 teaspoon oil. Spread half of tomato sauce over polenta, and top with 2 tablespoons Parmesan cheese and 1/8 teaspoon pepper. Drop half of the ricotta cheese by spoonfuls onto the Parmesan cheese. Repeat the layers, ending with polenta. Top with 1/4 cup Parmesan cheese and butter. Bake at 400° for 25 minutes or until bubbly.