Changing the PCIe BAR size - pci

Can somebody tell me how to increase the bar size (like by using setpci or some other way)?
I am able to read the BAR register and also able to determine the size of it. But what if i want to expand or contract the BAR size? For example : BAR 4 is prefetchable and size is "1M".
What if i wanna expand it to 16M ?
I am able successfully to do with the driver , but what if i wanna do it without the help of driver (like using setpci, as we can edit BAR register values ).

Address space for a PCI device is assigned very early in boot (on PCs, it's typically done in the BIOS before the OS is even loaded). There are some devices that do allow the BAR size to be changed but the way to do it would be very specific to the device. Likely, you would need to do something physically to the device (set a jumper), or write to some non-volatile storage (NVRAM or something) on the device because that setting will need to survive a reset or power-cycle.
If your device actually supports changing the BAR size, the datasheet should explain how to configure it. As #prl said, for most devices, it can't be changed.
From the host side, there is a protocol used by the PCI root complex during device enumeration to discover how much space the device "wants" and then to tell the device what address range it has been assigned (and therefore should respond to). But as mentioned above, it's usually done very early in boot, because it requires coordination: it's easy enough for you to write to the device config registers to tell it it has more address space, but the memory controller and root complex need to know that too, or the actual memory references won't ever reach the device (and the system will likely malfunction too). And you can't just expand that address window willy-nilly because there's probably some other device that has already been assigned the memory just above and below your device.

For most devices, the BAR size is a physical property of the device and can’t be changed.
The device implements a fixed amount of MMIO or memory, so there wouldn’t be any point in making the BAR larger than that.

Related

Touch screen panel using LVDS interface

Hi i am thinking to connect a 14 inch or bigger lcd touch screen with my discovery boards. Currently i have stm32f4 and stm32f7 discovery boards.
Currently i am aware of different methods to connect them. But i am most interested in LTDC. I have tried using old protocols like Motorola 6800 Parralel RGB. But Touch screens of bigger size and bigger resolution available on Alibaba for example does not support them.
Please correct me in my understanding if i am wrong that for bigger screen size and bigger resolution old protocols like Motorola 6800 , Intel® 8080 bus and SPI protocol wont work. Because bigger touch screens found in market does not have them.
Will Parallel RGB connection be able to work with bigger screen. If yes can u give me a link for that.
The devices i see are coming with lvds connection. Will they be able to work with stm32 discovery kits. If yes than how.
Finally can u suggest me some good working tutorials for them apart of datasheet.
Thank You !!!
Yes, RGB can be used to drive larger display panels. However, you will need to convert the signal to LVDS.
Assuming you are using the STM32756G-EVAL you could link the LCD modules connector (CN20) to J1 and J2 (depending whether your display panel is single or dual LVDS) of Texas Instruments’ LDI demo kit Transmitter board http://www.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=snlu036a

Moving GMSPanoramaView stacks up memory

I am creating an app that presents different locations in street view. But every time a new place is loading, the memory used is increased. This later leads to the app crashing. Is there any way to clear memory of past loaded street views?
The memory goes up every time a panorama is loaded.
1: test memory usage on device and not in simulator
2: remember ARC can free up memory when it decides too. Unless you really tell it to do so.
Did testing on device helped?

Reduce memory usage for universal app on the iPhone

I have a universal app that is essentially a list of articles with images and text, and menu under the left side of the app. I have google analytics in, as well as parse's framework.
The only difference between the app on the iPad and iPhone is that the side menu is always visible on the ipad, and a few interface objects are moved around. (different cell layout for the list--same content, though).
The images are loaded asynchronously using a set of classes that I wrote to download/save in an NSCache object and on the disk using a NSOperationQueue. (disk cache is wiped when the user leaves the app). The NSCache is set to max out at roughly 10 mb. (assuming image size is image hight*image width * 4 bytes per image). (code here is identical for both, so it shouldn't be the culprit, but it is a large chunk of the apps memory use).
I was having some trouble with memory warnings/crashing on an older iphone4 running iOS 5.0, so I ran the app with the Activity Monitor Instrument, and noticed something very odd:
On the iPad (an iPad 2 running iOS 5.1) the app launched, loaded the images that were visible immediately, and was using about 16mb of memory.
On the iPhone4 it launched, loaded the visible images and was using about 35mb of memory--way more than I would expect.
In order to check if it was an OS memory issue, I also ran the app on an iPhone5 running iOS6 and it used about the same amount as the iPhone 4.
I checked my media and the storyboard files to see if anything was different at all, and I could not find anything that could change the memory usage in any significant way.
Is there any way to reduce the memory use of the app on the iphone? I can think of no reason it would use so much memory.
Very difficult to see.. as one person stated pay attention that retina devices will use more memory according to the source, if in the bundle you set #2x images it will load them, and they use more memory.
Have tried to profile the Virtual memory using allocations?
Using memory is usually fine even if it fires a memory warning, the problem is how you respond to it, when it comes does it free enough memory? try with the simulator to simulate a memory warning. Pay attention that sim uses more memory than device.
One other point is that since ARC is difficult to create leaks, but it's easier to create retain cycle and abandoned memory. A correct object life cycle should end with object deallocation.
You say that you use NSCache and load images from the net async, I've got 3 suggestion for you :
Do you know the original image size on the source? maybe on the iPad source images are smaller than on iPhone. A correct approach after you download an image will be resize it according to the really needed size (I'm mean redrawing non just stretching) you ca achieve that with Quartz or using ImageIO
I never understood the behaviour of NSCache after memory warning, Apple says that it will flush the memory but after some test on iOS4 (I don't know now) I don't agree. I've created my own subclass that observe for memory warning and flushes memory
Are you totally sure that you are getting back image from the cache ?

Know what device in flash builder for mobile

I'm doing an application for mobile devices, specifically for iphone and ipad. And I want to use different interfaces for each. How can I do that? Is there a variable that holds the name of the device?
Such as
if(device=="iPhone")
{use this state}
else if (device=="iPad")
{use that state}
??
You can use Capabilities.os to obtain the device's operating system and see if it uses iOS, then use Capabilities.screenResolutionX and Capabilities.screenResolutionY to determine if the resolutions correspond to an iPhone or an iPad.
Look at this document which shows general principles for scaling things based on the screen resolution.
It is not an exact answer to your question but I am guessing that you just want to scale your interfaces based on the screen resolution.
You can also check the screen DPI using Capabilities.screenDPI. which is nice to know how spread out those pixels are along with Capabilities.screenResolutionX and Capabilities.screenResolutionY to get the resolution.
If you really want to know what the operating system is you can check using Capabilities.os, but as for an exact device I'm not sure if there is a method for that.

Images showing in simulator but not on the iPhone device

So when I run the application from the device the pictures show up and everything works great. However, when I move to the device I run in about 10 out of 38 pictures that don't show up. I am pulling the names for the images from an sqlite database and I already checked and the names are correct, case and everything. I checked the bundle and the images are correctly in there.
Does memory play into effect in this? I am not really sure what else could cause this to happen??
Thanks!
Solution:
The files somehow were not saved properly and were unable to be opened by say photoshop or paint even. So with the files not being able to be open they weren't showing up... Thanks for the help everyone!
First thing to check is the case of the strings you're using to refer to the resources. The iPhone is case sensitive, but the simulator is not.
Oops, just seen that you checked the case. Better log all your UIImage creation calls then!
The simulator accepts a wider range of image formats. Sometimes you had a specific file type that the device cannot display. Double check the 10 files looking for some difference from the others ones.
Yes, memory absolutely plays into this. Check your UIImage creation calls and make sure they dont return empty. Also, check to see if youre getting memory warnings in the console window.
Generally, if in-memory size was the culprit, your application would crash with a low memory error on the device. However, it seems like the images just don't display.
One other thing that can be going wrong is the size of the images. UIViews on the iPhone can only have dimensions smaller than the maximum texture size supported by the GPU. Apple states that this is 1024 x 1024, but I've found it to be more like 2048 x 2048 on even the original model iPhone. You may be creating a view for some of these images that exceeds this size in one dimension, but your Mac has a larger maximum texture size on its GPU and so it displays fine in the Simulator.
Apparently the iPhone caches the launch screens. So in my case, I had to reboot my iPhone before being able to see the image.