gergen
config.txt
ro.sf.swrotation=0
or
ro.sf.swrotation=90
And the file lsec6318update(If your device model is 7870), or lsec6315update(If your device model is 7862), or lsec6316update(If your device model is 8581).
Put these two files on a USB drive and connect it to your device.